/* Let's insist on O_DIRECTORY since the parent of a file or directory is a directory. Except if we open an
* O_TMPFILE file, because in that case we are actually create a regular file below the parent directory. */
- if ((flags & O_PATH) == O_PATH)
+ if (FLAGS_SET(flags, O_PATH))
flags |= O_DIRECTORY;
- else if ((flags & O_TMPFILE) != O_TMPFILE)
+ else if (!FLAGS_SET(flags, O_TMPFILE))
flags |= O_DIRECTORY|O_RDONLY;
fd = open(parent, flags, mode);
if ((u & NAMESPACE_FLAGS_ALL) == 0)
result = "yes";
- else if ((u & NAMESPACE_FLAGS_ALL) == NAMESPACE_FLAGS_ALL)
+ else if (FLAGS_SET(u, NAMESPACE_FLAGS_ALL))
result = "no";
else {
r = namespace_flags_to_string(u, &s);