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 /main.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 'main.c')
-rw-r--r-- | main.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -80,13 +80,12 @@ void toy_exec(char *argv[]) which = toy_find(argv[0]); if (!which) return; - toy_init(which, argv); - - exit(toys.which->toy_main()); + toys.which->toy_main(); + exit(toys.exitval); } -int toybox_main(void) +void toybox_main(void) { static char *toy_paths[]={"usr/","bin/","sbin/",0}; int i, len = 0; @@ -115,7 +114,6 @@ int toybox_main(void) } } putchar('\n'); - return 0; } int main(int argc, char *argv[]) @@ -132,5 +130,6 @@ int main(int argc, char *argv[]) } toys.argv = argv-1; - return toybox_main(); + toybox_main(); + return 0; } |