mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
tree-wide: swap arguments for streq()
We usually set a variable first, then constant.
This commit is contained in:
@@ -4418,7 +4418,7 @@ int config_parse_io_limit(
|
||||
if (r < 0)
|
||||
return 0;
|
||||
|
||||
if (streq("infinity", p))
|
||||
if (streq(p, "infinity"))
|
||||
num = CGROUP_LIMIT_MAX;
|
||||
else {
|
||||
r = parse_size(p, 1000, &num);
|
||||
|
||||
@@ -75,13 +75,13 @@ static const char *integrity_algorithm_select(const void *key_file_buf) {
|
||||
/* To keep a bit of sanity for end users, the subset of integrity
|
||||
algorithms we support will match what is used in integritysetup */
|
||||
if (arg_integrity_algorithm) {
|
||||
if (streq("hmac-sha256", arg_integrity_algorithm))
|
||||
if (streq(arg_integrity_algorithm, "hmac-sha256"))
|
||||
return DM_HMAC_256;
|
||||
if (streq("hmac-sha512", arg_integrity_algorithm))
|
||||
if (streq(arg_integrity_algorithm, "hmac-sha512"))
|
||||
return DM_HMAC_512;
|
||||
if (streq("phmac-sha256", arg_integrity_algorithm))
|
||||
if (streq(arg_integrity_algorithm, "phmac-sha256"))
|
||||
return DM_PHMAC_256;
|
||||
if (streq("phmac-sha512", arg_integrity_algorithm))
|
||||
if (streq(arg_integrity_algorithm, "phmac-sha512"))
|
||||
return DM_PHMAC_512;
|
||||
return arg_integrity_algorithm;
|
||||
} else if (key_file_buf)
|
||||
|
||||
@@ -383,14 +383,14 @@ TEST(message_container) {
|
||||
|
||||
ASSERT_OK(sd_netlink_message_enter_container(m, IFLA_LINKINFO));
|
||||
ASSERT_OK(sd_netlink_message_read_string(m, IFLA_INFO_KIND, &string_data));
|
||||
ASSERT_STREQ("vlan", string_data);
|
||||
ASSERT_STREQ(string_data, "vlan");
|
||||
|
||||
ASSERT_OK(sd_netlink_message_enter_container(m, IFLA_INFO_DATA));
|
||||
ASSERT_OK(sd_netlink_message_read_u16(m, IFLA_VLAN_ID, &u16_data));
|
||||
ASSERT_OK(sd_netlink_message_exit_container(m));
|
||||
|
||||
ASSERT_OK(sd_netlink_message_read_string(m, IFLA_INFO_KIND, &string_data));
|
||||
ASSERT_STREQ("vlan", string_data);
|
||||
ASSERT_STREQ(string_data, "vlan");
|
||||
ASSERT_OK(sd_netlink_message_exit_container(m));
|
||||
|
||||
ASSERT_FAIL(sd_netlink_message_read_u32(m, IFLA_LINKINFO, &u32_data));
|
||||
|
||||
@@ -433,12 +433,12 @@ TEST(chase) {
|
||||
|
||||
r = chase(p, NULL, CHASE_STEP, &result, NULL);
|
||||
assert_se(r == 0);
|
||||
ASSERT_STREQ("/usr", result);
|
||||
ASSERT_STREQ(result, "/usr");
|
||||
result = mfree(result);
|
||||
|
||||
r = chase("/usr", NULL, CHASE_STEP, &result, NULL);
|
||||
assert_se(r > 0);
|
||||
ASSERT_STREQ("/usr", result);
|
||||
ASSERT_STREQ(result, "/usr");
|
||||
result = mfree(result);
|
||||
|
||||
/* Make sure that symlinks in the "root" path are not resolved, but those below are */
|
||||
|
||||
Reference in New Issue
Block a user