aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-05-03 16:25:09 -0500
committerRob Landley <rob@landley.net>2015-05-03 16:25:09 -0500
commitabb5ae390342acf8eea2903033fb1d5879845b43 (patch)
treed7e3c44e1eaa638bd84e4cf8ea57757dd87ce9ac
parent9398f05d34453e9306f7a91993ee4c8fcf1102ec (diff)
downloadtoybox-abb5ae390342acf8eea2903033fb1d5879845b43.tar.gz
Fix dmesg -c error output.
Use perror_exit to show the likely "Operation not permitted" if klogctl fails.
-rw-r--r--toys/lsb/dmesg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/lsb/dmesg.c b/toys/lsb/dmesg.c
index aac638d0..d6084466 100644
--- a/toys/lsb/dmesg.c
+++ b/toys/lsb/dmesg.c
@@ -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