From abb5ae390342acf8eea2903033fb1d5879845b43 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sun, 3 May 2015 16:25:09 -0500 Subject: Fix dmesg -c error output. Use perror_exit to show the likely "Operation not permitted" if klogctl fails. --- toys/lsb/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/lsb/dmesg.c') 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 -- cgit v1.2.3