summaryrefslogtreecommitdiff
path: root/dmesg.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-12-22 01:48:07 +0000
committerMatt Kraai <kraai@debian.org>2000-12-22 01:48:07 +0000
commita9819b290848e0a760f3805d5937fa050235d707 (patch)
treeb8cb8d939032c0806d62161b01e5836cb808dc3f /dmesg.c
parente9f07fb6e83b75a50760599a5d31f494841eddf7 (diff)
downloadbusybox-a9819b290848e0a760f3805d5937fa050235d707.tar.gz
Use busybox error handling functions wherever possible.
Diffstat (limited to 'dmesg.c')
-rw-r--r--dmesg.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/dmesg.c b/dmesg.c
index 1d33b7641..c220d9018 100644
--- a/dmesg.c
+++ b/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;
}