login: use NULL to denote arg-less method call

"" and NULL are equivalent, but the latter is normally used.
This commit is contained in:
David Tardon
2023-05-24 08:29:22 +02:00
parent d962e73796
commit 6ce68c7c51
3 changed files with 3 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ static int print_inhibitors(sd_bus *bus) {
pager_open(arg_pager_flags);
r = bus_call_method(bus, bus_login_mgr, "ListInhibitors", &error, &reply, "");
r = bus_call_method(bus, bus_login_mgr, "ListInhibitors", &error, &reply, NULL);
if (r < 0)
return log_error_errno(r, "Could not get active inhibitors: %s", bus_error_message(&error, r));

View File

@@ -35,7 +35,7 @@ static void print_inhibitors(sd_bus *bus) {
unsigned n = 0;
int r;
r = bus_call_method(bus, bus_login_mgr, "ListInhibitors", &error, &reply, "");
r = bus_call_method(bus, bus_login_mgr, "ListInhibitors", &error, &reply, NULL);
assert_se(r >= 0);
r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssssuu)");

View File

@@ -57,7 +57,7 @@ TEST(set_type) {
/* Type is reset to the original value when we release control of the session */
assert_se(!streq(type, "tty"));
assert_se(bus_call_method(bus, &session, "ReleaseControl", NULL, NULL, "") >= 0);
assert_se(bus_call_method(bus, &session, "ReleaseControl", NULL, NULL, NULL) >= 0);
type = mfree(type);
assert_se(bus_get_property_string(bus, &session, "Type", NULL, &type) >= 0);
assert_se(streq(type, "tty"));