if (v->gvrp != -1) {
flags.mask |= VLAN_FLAG_GVRP;
-
- if (v->gvrp)
- flags.flags |= VLAN_FLAG_GVRP;
- else
- flags.flags &= ~VLAN_FLAG_GVRP;
+ SET_FLAG(flags.flags, VLAN_FLAG_GVRP, v->gvrp);
}
r = sd_netlink_message_append_data(req, IFLA_VLAN_FLAGS, &flags, sizeof(struct ifla_vlan_flags));
return 0;
}
- if (r)
- n->flags |= RTNH_F_ONLINK;
- else
- n->flags &= ~RTNH_F_ONLINK;
+ SET_FLAG(n->flags, RTNH_F_ONLINK, r);
n = NULL;
return 0;
if (r < 0) {
log_warning_errno(r, "Failed to parse SYSTEMD_NSPAWN_API_VFS_WRITABLE from environment, ignoring.");
return;
- } else if (r > 0)
- arg_mount_settings &= ~MOUNT_APPLY_APIVFS_RO;
- else
- arg_mount_settings |= MOUNT_APPLY_APIVFS_RO;
+ }
- arg_mount_settings &= ~MOUNT_APPLY_APIVFS_NETNS;
+ SET_FLAG(arg_mount_settings, MOUNT_APPLY_APIVFS_RO, r == 0);
+ SET_FLAG(arg_mount_settings, MOUNT_APPLY_APIVFS_NETNS, false);
}
static int parse_argv(int argc, char *argv[]) {
r = tcgetattr(fd, &tc);
if (r >= 0) {
- if (utf8)
- tc.c_iflag |= IUTF8;
- else
- tc.c_iflag &= ~IUTF8;
+ SET_FLAG(tc.c_iflag, IUTF8, utf8);
r = tcsetattr(fd, TCSANOW, &tc);
}
if (r < 0)