tree-wide: use SET_FLAG in more places (#5892)
This commit is contained in:
parent
f7bf1abef9
commit
ab8ee0f259
|
@ -42,11 +42,7 @@ static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlin
|
|||
|
||||
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));
|
||||
|
|
|
@ -973,10 +973,7 @@ int config_parse_gateway_onlink(const char *unit,
|
|||
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;
|
||||
|
|
|
@ -389,12 +389,10 @@ static void parse_mount_settings_env(void) {
|
|||
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[]) {
|
||||
|
|
|
@ -99,10 +99,7 @@ static int toggle_utf8(const char *name, int fd, bool utf8) {
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue