mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +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
14
ircd/fs.cc
14
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(!opts.offset)
|
||||
opts.offset = syscall(::lseek, fd, 0, SEEK_END);
|
||||
}
|
||||
else opts.offset = -1;
|
||||
|
||||
#if defined(RWF_APPEND)
|
||||
if(aio::support_append)
|
||||
opts.offset = -1;
|
||||
#endif
|
||||
|
||||
if(!opts.offset)
|
||||
opts.offset = syscall(::lseek, fd, 0, SEEK_END);
|
||||
|
||||
return write(fd, bufs, opts);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue