diff options
author | Rob Landley <rob@landley.net> | 2007-11-29 18:14:37 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-11-29 18:14:37 -0600 |
commit | efda21ca931766eed6cfc49d1b2122c53827d9fc (patch) | |
tree | 16453d708a1b0fc6b325ada99bbe72cbaab7148b /toys/dmesg.c | |
parent | 7634b55f27ad483ec634ba9defac93872e3a329f (diff) | |
download | toybox-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.c | 8 |
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; } |