diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-10-04 23:01:32 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-10-04 16:01:32 +0200 |
commit | 4c701096002fff540d9ddb3b21398c551ac3af78 (patch) | |
tree | 537e654dc92baa5eed5b6ff69867114384ecfa47 /src/udev/udev-node.c | |
parent | 6d0aa4db7b33c9ce71b820c76428a1cfd24fb56f (diff) | |
download | systemd-4c701096002fff540d9ddb3b21398c551ac3af78.tar.gz systemd-4c701096002fff540d9ddb3b21398c551ac3af78.tar.bz2 systemd-4c701096002fff540d9ddb3b21398c551ac3af78.zip |
tree-wide: use IN_SET macro (#6977)
Diffstat (limited to 'src/udev/udev-node.c')
-rw-r--r-- | src/udev/udev-node.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index 53cfd9c053..01e56cac36 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -87,7 +87,7 @@ static int node_symlink(struct udev_device *dev, const char *node, const char *s log_debug("creating symlink '%s' to '%s'", slink, target); do { err = mkdir_parents_label(slink, 0755); - if (err != 0 && err != -ENOENT) + if (!IN_SET(err, 0, -ENOENT)) break; mac_selinux_create_file_prepare(slink, S_IFLNK); err = symlink(target, slink); @@ -104,7 +104,7 @@ static int node_symlink(struct udev_device *dev, const char *node, const char *s unlink(slink_tmp); do { err = mkdir_parents_label(slink_tmp, 0755); - if (err != 0 && err != -ENOENT) + if (!IN_SET(err, 0, -ENOENT)) break; mac_selinux_create_file_prepare(slink_tmp, S_IFLNK); err = symlink(target, slink_tmp); @@ -209,7 +209,7 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) { int fd; err = mkdir_parents(filename, 0755); - if (err != 0 && err != -ENOENT) + if (!IN_SET(err, 0, -ENOENT)) break; fd = open(filename, O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444); if (fd >= 0) |