]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vconsole-setup: add more log messages
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 May 2017 03:25:10 +0000 (23:25 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 May 2017 03:25:10 +0000 (23:25 -0400)
This makes it quite a bit easier to see what failed.

strv_join is called inline in log_debug so that it is under the conditional
that kills the whole thing if debugging is disabled.

src/vconsole/vconsole-setup.c

index 36d04d49c10656107d39d2662ef280b00c470d36..3e8d1c2a518dd039b5d73dc4fd79a69c2186f908 100644 (file)
@@ -41,6 +41,7 @@
 #include "signal-util.h"
 #include "stdio-util.h"
 #include "string-util.h"
+#include "strv.h"
 #include "terminal-util.h"
 #include "util.h"
 #include "virt.h"
@@ -121,6 +122,7 @@ static int toggle_utf8_sysfs(bool utf8) {
 }
 
 static int keyboard_load_and_wait(const char *vc, const char *map, const char *map_toggle, bool utf8) {
+        _cleanup_free_ char *cmd = NULL;
         const char *args[8];
         int i = 0;
         pid_t pid;
@@ -140,6 +142,9 @@ static int keyboard_load_and_wait(const char *vc, const char *map, const char *m
                 args[i++] = map_toggle;
         args[i++] = NULL;
 
+        log_debug("Executing \"%s\"...",
+                  strnull((cmd = strv_join((char**) args, " "))));
+
         pid = fork();
         if (pid < 0)
                 return log_error_errno(errno, "Failed to fork: %m");
@@ -156,6 +161,7 @@ static int keyboard_load_and_wait(const char *vc, const char *map, const char *m
 }
 
 static int font_load_and_wait(const char *vc, const char *font, const char *map, const char *unimap) {
+        _cleanup_free_ char *cmd = NULL;
         const char *args[9];
         int i = 0;
         pid_t pid;
@@ -179,6 +185,9 @@ static int font_load_and_wait(const char *vc, const char *font, const char *map,
                 args[i++] = font;
         args[i++] = NULL;
 
+        log_debug("Executing \"%s\"...",
+                  strnull((cmd = strv_join((char**) args, " "))));
+
         pid = fork();
         if (pid < 0)
                 return log_error_errno(errno, "Failed to fork: %m");