Lines Matching refs:which
33 // skip the first entry, which is out of order.
69 toys.which = toy_list;
74 static void toy_singleinit(struct toy_list *which, char *argv[])
76 toys.which = which;
83 if (CFG_TOYBOX_HELP_DASHDASH && !(which->flags & TOYFLAG_NOHELP) && argv[1]) {
85 if (CFG_TOYBOX && toys.which == toy_list && toys.argv[2])
86 if (!(toys.which = toy_find(toys.argv[2]))) unknown(toys.argv[2]);
97 if (NEED_OPTIONS && which->options) get_optflags();
103 if (!(which->flags & TOYFLAG_UMASK)) umask(toys.old_umask);
109 void toy_init(struct toy_list *which, char *argv[])
111 void *oldwhich = toys.which;
116 if (!toys.which) toys.which = toy_list;
120 if (!(which->flags & TOYFLAG_STAYROOT)) {
126 } else if (CFG_TOYBOX_DEBUG && uid && which != toy_list)
129 if ((which->flags & TOYFLAG_NEEDROOT) && euid) help_exit("Not root");
139 toy_singleinit(which, argv);
144 void toy_exec_which(struct toy_list *which, char *argv[])
146 // Return if we can't find it (which includes no multiplexer case),
147 if (!which) return;
156 if (labs((long)toys.stacktop-(long)&which)>6000) return;
159 if (toys.which && (which->flags&TOYFLAG_ROOTONLY) && toys.wasroot) return;
162 toy_init(which, argv);
163 if (toys.which) toys.which->toy_main();
181 // (Leave toys.which null to disable suid return logic.)
194 toys.which = toy_list;