*/
for (x = bltins; x->cmd; x++) {
if (strcmp(child->argv[0], x->cmd) == 0 ) {
- exit(x->function(child));
+ _exit(x->function(child));
}
}
for (x = bltins_forking; x->cmd; x++) {
if (strcmp(child->argv[0], x->cmd) == 0) {
applet_name=x->cmd;
- exit (x->function(child));
+ _exit (x->function(child));
}
}
#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
#endif
execvp(child->argv[0], child->argv);
- perror_msg_and_die("%s", child->argv[0]);
+
+ /* Do not use perror_msg_and_die() here, since we must not
+ * call exit() but should call _exit() instead */
+ fprintf(stderr, "%s: %s\n", child->argv[0], strerror(err));
+ _exit(EXIT_FAILURE);
}
static void insert_job(struct job *newjob, int inbg)