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:
parent
2c2fd658ee
commit
d3eee15f84
|
|
@ -299,7 +299,7 @@ callback_truncate (const char *path, off_t size)
|
||||||
path = ENSURE_RELPATH (path);
|
path = ENSURE_RELPATH (path);
|
||||||
VERIFY_WRITE(path);
|
VERIFY_WRITE(path);
|
||||||
|
|
||||||
fd = openat (basefd, path, O_RDWR | O_CREAT);
|
fd = openat (basefd, path, O_WRONLY);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue