diff options
-rw-r--r-- | ChangeLog.txt | 5 | ||||
-rw-r--r-- | ports/linux/guts/openat.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 84c5d5a..a6e4c79 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,8 @@ +2018-02-15: + * (seebs) O_TMPFILE is actually some other flag AND O_DIRECTORYy, + so a test for (flags & O_TMPFILE) does not actually test that + O_TMPFILE is set. + 2018-01-20: * (seebs) merge patch from <joshua.g.lock@linux.intel.com> to fix open/openat flags. diff --git a/ports/linux/guts/openat.c b/ports/linux/guts/openat.c index b571c56..924e354 100644 --- a/ports/linux/guts/openat.c +++ b/ports/linux/guts/openat.c @@ -42,7 +42,7 @@ /* don't handle O_CREAT the same way if O_TMPFILE exists * and is set. */ - if (flags & O_TMPFILE) { + if ((flags & O_TMPFILE) == O_TMPFILE) { existed = 0; } else #endif @@ -80,7 +80,7 @@ * database, because there's no directory entries for * the file yet. */ - if (flags & O_TMPFILE) { + if ((flags & O_TMPFILE) == O_TMPFILE) { real_fchmod(rc, PSEUDO_FS_MODE(mode, 0)); errno = save_errno; return rc; |