diff options
Diffstat (limited to 'util-linux/dmesg.c')
-rw-r--r-- | util-linux/dmesg.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 1d33b76..c220d90 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c @@ -69,20 +69,16 @@ int dmesg_main(int argc, char **argv) } if (cmd == 8) { - n = klogctl(cmd, NULL, level); - if (n < 0) { - goto klogctl_error; - } + if (klogctl(cmd, NULL, level) < 0) + perror_msg_and_die("klogctl"); return EXIT_SUCCESS; } if (bufsize < 4096) bufsize = 4096; buf = (char *) xmalloc(bufsize); - n = klogctl(cmd, buf, bufsize); - if (n < 0) { - goto klogctl_error; - } + if ((n = klogctl(cmd, buf, bufsize)) < 0) + perror_msg_and_die("klogctl"); lastc = '\n'; for (i = 0; i < n; i++) { @@ -102,7 +98,4 @@ int dmesg_main(int argc, char **argv) end: usage(dmesg_usage); return EXIT_FAILURE; - klogctl_error: - perror("klogctl"); - return EXIT_FAILURE; } |