aboutsummaryrefslogtreecommitdiff
path: root/toys/dmesg.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-11-29 18:14:37 -0600
committerRob Landley <rob@landley.net>2007-11-29 18:14:37 -0600
commitefda21ca931766eed6cfc49d1b2122c53827d9fc (patch)
tree16453d708a1b0fc6b325ada99bbe72cbaab7148b /toys/dmesg.c
parent7634b55f27ad483ec634ba9defac93872e3a329f (diff)
downloadtoybox-efda21ca931766eed6cfc49d1b2122c53827d9fc.tar.gz
Change command main() functions to return void, and exit(toys.exitval) from
the toybox infrastructure instead. Eliminates a return call from each command.
Diffstat (limited to 'toys/dmesg.c')
-rw-r--r--toys/dmesg.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/toys/dmesg.c b/toys/dmesg.c
index 7a150121..59343897 100644
--- a/toys/dmesg.c
+++ b/toys/dmesg.c
@@ -10,7 +10,7 @@
#define TT toy.dmesg
-int dmesg_main(void)
+void dmesg_main(void)
{
// For -n just tell kernel to which messages to keep.
if (toys.optflags & 2) {
@@ -30,11 +30,9 @@ int dmesg_main(void)
// Display data, filtering out level markers.
for (i=0; i<size; ) {
if (last=='\n' && data[i]=='<') i += 3;
- else putchar(last = data[i++]);
+ else xputc(last = data[i++]);
}
- if (last!='\n') putchar('\n');
+ if (last!='\n') xputc('\n');
if (CFG_TOYBOX_FREE) free(data);
}
-
- return 0;
}