projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c2fd65
)
rofiles-fuse: Fix truncate call to not use O_CREAT
author
Colin Walters
<walters@verbum.org>
Wed, 17 Feb 2016 16:01:21 +0000
(11:01 -0500)
committer
Colin Walters
<walters@verbum.org>
Wed, 17 Feb 2016 16:06:53 +0000
(11:06 -0500)
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.
src/rofiles-fuse/main.c
patch
|
blob
|
history
diff --git
a/src/rofiles-fuse/main.c
b/src/rofiles-fuse/main.c
index 004ad3d2b982960666cf4e3cfbb262f3d4818c45..4337f00fee17e2b76742f24b8367c96cb3b5b863 100644
(file)
--- a/
src/rofiles-fuse/main.c
+++ b/
src/rofiles-fuse/main.c
@@
-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;