summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5c1b50f)
No effect on Linux, but it's more correct to explicitly check for
the O_ACCMODE bits being O_WRONLY or O_RDWR.
static inline int
flags_writable(int open_flags)
{
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);