aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-11 16:35:14 -0500
committerRob Landley <rob@landley.net>2015-09-11 16:35:14 -0500
commite5354ca12a232b3f97726214254a868771cb70d1 (patch)
treeba373c24ede64b8a18f11a02cf834ce99aa586bf /main.c
parentd067571abb2b7934f3350c90ca891beb987c68fd (diff)
downloadtoybox-e5354ca12a232b3f97726214254a868771cb70d1.tar.gz
Replace toys.exithelp with help_exit() in lib.
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/main.c b/main.c
index 0738a178..dcd486eb 100644
--- a/main.c
+++ b/main.c
@@ -78,7 +78,7 @@ static void toy_singleinit(struct toy_list *which, char *argv[])
if (CFG_TOYBOX_HELP_DASHDASH && argv[1] && !strcmp(argv[1], "--help")) {
if (CFG_TOYBOX && toys.which == toy_list && toys.argv[2])
if (!(toys.which = toy_find(toys.argv[2]))) return;
- show_help();
+ show_help(stdout);
xexit();
}
@@ -110,10 +110,7 @@ void toy_init(struct toy_list *which, char *argv[])
} else if (CFG_TOYBOX_DEBUG && uid && which != toy_list)
error_msg("Not installed suid root");
- if ((which->flags & TOYFLAG_NEEDROOT) && euid) {
- toys.exithelp++;
- error_exit("Not root");
- }
+ if ((which->flags & TOYFLAG_NEEDROOT) && euid) help_exit("Not root");
}
// Free old toys contents (to be reentrant), but leave rebound if any