#include "../general/general.h"
#include "../general/globals.h"
static int shell_pid
= 0;
while ((pid
= wait3(status
, WNOHANG
, 0)) > 0) {
signal(SIGCHLD
, child_died
);
* shell_continue() actually runs the command, and looks for API
* requests coming back in.
* We are called from the main loop in telnet.c.
* Called from telnet.c to fork a lower command.com. We
* use the spint... routines so that we can pick up
* interrupts generated by application programs.
if ((shell_pid
= fork()) {
shell_active
= 1; /* We are running down below */
child_killed(); /* Start up signal handler */
} else { /* New process */
for (i
= 3; i
< 30; i
++) {
if (argc
== 1) { /* Just get a shell */
cmdname
= getenv("SHELL");
execlp(cmdname
, cmdname
, 0);
perror("Exec'ing new shell...\n");
execvp(argv
[1], &argv
[1]);
perror("Exec'ing command.\n");
return 1; /* Go back to main loop */