From: Lennart Poettering Date: Tue, 2 Apr 2019 12:49:28 +0000 (+0200) Subject: util-lib: use FLAGS_SET() where appropriate X-Git-Tag: v242-rc1~4^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c21dafb54dea7564c6a0f063492926f495006b9;p=thirdparty%2Fsystemd.git util-lib: use FLAGS_SET() where appropriate --- diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 9f3fd456911..d1c06cf12a3 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -1411,9 +1411,9 @@ int open_parent(const char *path, int flags, mode_t mode) { /* 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); diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 1911dd0ce64..00120e98741 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -756,7 +756,7 @@ static int bus_print_property(const char *name, const char *expected_value, sd_b 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);