mirror of
https://github.com/matrix-construct/construct
synced 2024-12-01 19:22:53 +01:00
ircd::fs: Don't set -1 offset on systems without RWF_APPEND.
This commit is contained in:
parent
293f6d5480
commit
353fc35df4
1 changed files with 8 additions and 6 deletions
10
ircd/fs.cc
10
ircd/fs.cc
|
@ -793,12 +793,14 @@ ircd::fs::append(const fd &fd,
|
|||
const write_opts &opts_)
|
||||
{
|
||||
auto opts(opts_);
|
||||
if(!aio::support_append)
|
||||
{
|
||||
|
||||
#if defined(RWF_APPEND)
|
||||
if(aio::support_append)
|
||||
opts.offset = -1;
|
||||
#endif
|
||||
|
||||
if(!opts.offset)
|
||||
opts.offset = syscall(::lseek, fd, 0, SEEK_END);
|
||||
}
|
||||
else opts.offset = -1;
|
||||
|
||||
return write(fd, bufs, opts);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue