git://wimlib.net
/
wimlib
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c1b50f
)
mount_image.c: Use well-defined check in flags_writable()
author
Eric Biggers
<ebiggers3@gmail.com>
Mon, 10 Feb 2014 00:22:35 +0000
(18:22 -0600)
committer
Eric Biggers
<ebiggers3@gmail.com>
Mon, 10 Feb 2014 00:24:18 +0000
(18:24 -0600)
No effect on Linux, but it's more correct to explicitly check for
the O_ACCMODE bits being O_WRONLY or O_RDWR.
src/mount_image.c
patch
|
blob
|
history
diff --git
a/src/mount_image.c
b/src/mount_image.c
index 04be3f6f73c8e3ea9b6b87de79959921ee3302b9..586722e50fc84fb25c27f1a127583b8a4d6c4da5 100644
(file)
--- a/
src/mount_image.c
+++ b/
src/mount_image.c
@@
-164,7
+164,8
@@
get_lookup_flags(const struct wimfs_context *ctx)
static inline int
flags_writable(int open_flags)
{
- return open_flags & (O_RDWR | O_WRONLY);
+ int accmode = (open_flags & O_ACCMODE);
+ return (accmode == O_RDWR || accmode == O_WRONLY);
}
/*