rofiles-fuse: Fix truncate call to not use O_CREAT

I was getting a compilation error with the GCC hardening flags which
look for a missing mode with `O_CREAT`.  The right fix here is to drop
`O_CREAT`, as truncate() should throw `ENOENT` if the file doesn't
exist.
This commit is contained in:
Colin Walters 2016-02-17 11:01:21 -05:00
parent 2c2fd658ee
commit d3eee15f84
1 changed files with 1 additions and 1 deletions

View File

@ -299,7 +299,7 @@ callback_truncate (const char *path, off_t size)
path = ENSURE_RELPATH (path);
VERIFY_WRITE(path);
fd = openat (basefd, path, O_RDWR | O_CREAT);
fd = openat (basefd, path, O_WRONLY);
if (fd == -1)
return -errno;