OSDN Git Service

Fix dmesg -c error output.
authorElliott Hughes <enh@google.com>
Sun, 3 May 2015 21:25:09 +0000 (16:25 -0500)
committerRob Landley <rob@landley.net>
Sun, 3 May 2015 21:25:09 +0000 (16:25 -0500)
Use perror_exit to show the likely "Operation not permitted" if klogctl fails.

toys/lsb/dmesg.c

index aac638d..d608446 100644 (file)
@@ -45,7 +45,7 @@ void dmesg_main(void)
     if (!size && 1>(size = klogctl(10, 0, 0))) perror_exit("klogctl");;
     data = to = from = xmalloc(size+1);
     size = klogctl(3 + (toys.optflags & FLAG_c), data, size);
-    if (size < 0) error_exit("klogctl");
+    if (size < 0) perror_exit("klogctl");
     data[size] = 0;
 
     // Filter out level markers and optionally time markers