chiark / gitweb /
bus: fix a couple of format string mistakes
authorLennart Poettering <lennart@poettering.net>
Sat, 28 Dec 2013 14:05:45 +0000 (15:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 28 Dec 2013 14:09:26 +0000 (15:09 +0100)
src/core/dbus-manager.c
src/core/dbus.c
src/locale/localed.c
src/login/logind-dbus.c

index 38004a0..5a998e3 100644 (file)
@@ -547,7 +547,7 @@ static int method_start_transient_unit(sd_bus *bus, sd_bus_message *message, voi
                 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid unit type.");
 
         if (!unit_vtable[t]->can_transient)
-                return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unit type %s does not support transient units.");
+                return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unit type %s does not support transient units.", unit_type_to_string(t));
 
         mode = job_mode_from_string(smode);
         if (mode < 0)
index 967f991..4111a14 100644 (file)
@@ -173,7 +173,7 @@ static int signal_activation_request(sd_bus *bus, sd_bus_message *message, void
                 goto failed;
 
         if (u->refuse_manual_start) {
-                r = sd_bus_error_setf(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, %u may be requested by dependency only.", u->id);
+                r = sd_bus_error_setf(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, %s may be requested by dependency only.", u->id);
                 goto failed;
         }
 
index a1e0ab6..7a6a96f 100644 (file)
@@ -948,7 +948,7 @@ static int method_set_vc_keyboard(sd_bus *bus, sd_bus_message *m, void *userdata
 
                 if ((keymap && (!filename_is_safe(keymap) || !string_is_safe(keymap))) ||
                     (keymap_toggle && (!filename_is_safe(keymap_toggle) || !string_is_safe(keymap_toggle))))
-                        return sd_bus_error_set_errnof(error, r, "Received invalid keymap data: %s", -EINVAL);
+                        return sd_bus_error_set_errnof(error, -EINVAL, "Received invalid keymap data");
 
                 r = bus_verify_polkit_async(bus, &c->polkit_registry, m,
                                 "org.freedesktop.locale1.set-keyboard",
@@ -1020,7 +1020,7 @@ static int method_set_x11_keyboard(sd_bus *bus, sd_bus_message *m, void *userdat
                     (model && !string_is_safe(model)) ||
                     (variant && !string_is_safe(variant)) ||
                     (options && !string_is_safe(options)))
-                        return sd_bus_error_set_errnof(error, r, "Received invalid keyboard data: %s", -EINVAL);
+                        return sd_bus_error_set_errnof(error, -EINVAL, "Received invalid keyboard data");
 
                 r = bus_verify_polkit_async(bus, &c->polkit_registry, m,
                                 "org.freedesktop.locale1.set-keyboard",
index 7ece815..08510b5 100644 (file)
@@ -495,7 +495,7 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use
         else {
                 seat = hashmap_get(m->seats, cseat);
                 if (!seat)
-                        return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", seat);
+                        return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", cseat);
         }
 
         if (tty_is_vc(tty)) {
@@ -504,7 +504,7 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use
                 if (!seat)
                         seat = m->seat0;
                 else if (seat != m->seat0)
-                        return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "TTY %s is virtual console but seat %s is not seat0", tty, seat);
+                        return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "TTY %s is virtual console but seat %s is not seat0", tty, seat->id);
 
                 v = vtnr_from_tty(tty);
                 if (v <= 0)