]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
login: use NULL to denote arg-less method call
authorDavid Tardon <dtardon@redhat.com>
Wed, 24 May 2023 06:29:22 +0000 (08:29 +0200)
committerDavid Tardon <dtardon@redhat.com>
Wed, 24 May 2023 06:32:13 +0000 (08:32 +0200)
"" and NULL are equivalent, but the latter is normally used.

src/login/inhibit.c
src/login/test-inhibit.c
src/login/test-session-properties.c

index 9d0d97c22cc1517721d05d3bf4268d597679022a..75dba8c08f5dde213ff65efda91ec84d26f7f2a1 100644 (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));
 
index b2a5dfecc82a423e89498ba600a19802687c4c76..f59cca8fed7b45bd3bdf42b0fd6595faeaa2356c 100644 (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)");
index 48aa21abef290a0dfb4925d3baf170773b2973e9..b5b5f60eaaac29b82fe1c3a9b323f365f27544bf 100644 (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"));