optind = 1;
debug_printf("running applet %s\n", name);
run_applet_by_name(name, argc_l, child->argv);
- exit(1);
}
#endif
debug_printf("exec of %s\n",child->argv[0]);
}
}
+ if (childpid == -1 && errno != ECHILD)
+ perror_msg("waitpid");
+
/* move the shell to the foreground */
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
perror_msg("tcsetpgrp");
-
- if (childpid == -1 && errno != ECHILD)
- perror_msg("waitpid");
}
/* run_pipe_real() starts all the jobs, but doesn't wait for anything
pi->pgrp = 0;
/* Check if we are supposed to run in the foreground */
- if (pi->followup!=PIPE_BG) {
+ if (interactive && pi->followup!=PIPE_BG) {
if ((pi->pgrp = tcgetpgrp(ctty = 2)) < 0
&& (pi->pgrp = tcgetpgrp(ctty = 0)) < 0
&& (pi->pgrp = tcgetpgrp(ctty = 1)) < 0)
old->child->group = ctx->list_head;
*ctx = *old; /* physical copy */
free(old);
- ctx->w=RES_NONE;
}
b_reset (dest);
return 1;