Lines Matching refs:which
34 // skip the first entry, which is out of order.
70 toys.which = toy_list;
75 static void toy_singleinit(struct toy_list *which, char *argv[])
77 toys.which = which;
84 if (CFG_TOYBOX_HELP_DASHDASH && !(which->flags & TOYFLAG_NOHELP) && argv[1]) {
86 if (CFG_TOYBOX && toys.which == toy_list && toys.argv[2])
87 if (!(toys.which = toy_find(toys.argv[2]))) unknown(toys.argv[2]);
98 if (NEED_OPTIONS && which->options) get_optflags();
104 if (!(which->flags & TOYFLAG_UMASK)) umask(toys.old_umask);
110 void toy_init(struct toy_list *which, char *argv[])
112 void *oldwhich = toys.which;
117 if (!toys.which) toys.which = toy_list;
121 if (!(which->flags & TOYFLAG_STAYROOT)) {
127 } else if (CFG_TOYBOX_DEBUG && uid && which != toy_list)
130 if ((which->flags & TOYFLAG_NEEDROOT) && euid != KERNEL_PROCESS_GROUP) help_exit("Not root");
140 toy_singleinit(which, argv);
145 void toy_exec_which(struct toy_list *which, char *argv[])
147 // Return if we can't find it (which includes no multiplexer case),
148 if (!which) return;
157 if (labs((long)toys.stacktop-(long)&which)>6000) return;
160 if (toys.which && (which->flags&TOYFLAG_ROOTONLY) && toys.wasroot) return;
163 toy_init(which, argv);
164 if (toys.which) toys.which->toy_main();
182 // (Leave toys.which null to disable suid return logic.)
195 toys.which = toy_list;