0
0
Fork 0
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:
Jason Volk 2019-03-15 18:34:35 -07:00
parent 293f6d5480
commit 353fc35df4

View file

@ -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);
}