summaryrefslogtreecommitdiff
path: root/util-linux/dmesg.c
diff options
context:
space:
mode:
authorMatt Kraai2000-12-22 01:48:07 +0000
committerMatt Kraai2000-12-22 01:48:07 +0000
commita9819b290848e0a760f3805d5937fa050235d707 (patch)
treeb8cb8d939032c0806d62161b01e5836cb808dc3f /util-linux/dmesg.c
parente9f07fb6e83b75a50760599a5d31f494841eddf7 (diff)
downloadbusybox-a9819b290848e0a760f3805d5937fa050235d707.zip
busybox-a9819b290848e0a760f3805d5937fa050235d707.tar.gz
Use busybox error handling functions wherever possible.
Diffstat (limited to 'util-linux/dmesg.c')
-rw-r--r--util-linux/dmesg.c15
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;
}