--- ray/src/util/netproc.c 2003/06/30 14:59:13 2.11 +++ ray/src/util/netproc.c 2003/11/11 16:24:06 2.14 @@ -1,11 +1,13 @@ #ifndef lint -static const char RCSid[] = "$Id: netproc.c,v 2.11 2003/06/30 14:59:13 schorsch Exp $"; +static const char RCSid[] = "$Id: netproc.c,v 2.14 2003/11/11 16:24:06 greg Exp $"; #endif /* * Parallel network process handling routines */ +#include #include +#include #include #include #include @@ -13,11 +15,10 @@ static const char RCSid[] = "$Id: netproc.c,v 2.11 200 #include "selcall.h" #include "netproc.h" #include "paths.h" -#include "vfork.h" PSERVER *pslist = NULL; /* global process server list */ -static PROC *pindex[FD_SETSIZE]; /* process index table */ +static NETPROC *pindex[FD_SETSIZE]; /* process index table */ static char ourhost[64]; /* this host name */ static char ourdir[PATH_MAX]; /* our working directory */ @@ -29,9 +30,7 @@ static int maxfd; /* maximum assigned descriptor */ extern char *remsh; /* externally defined remote shell program */ -extern char *getenv(); - PSERVER * addpserver(host, dir, usr, np) /* add a new process server */ char *host, *dir, *usr; @@ -41,7 +40,7 @@ int np; /* allocate the struct */ if (np < 1) return(NULL); - ps = (PSERVER *)malloc(sizeof(PSERVER)+(np-1)*sizeof(PROC)); + ps = (PSERVER *)malloc(sizeof(PSERVER)+(np-1)*sizeof(NETPROC)); if (ps == NULL) return(NULL); if (!ourhost[0]) { /* initialize */ @@ -173,7 +172,7 @@ int (*compf)(); exit(1); } /* start child process */ - if ((pid = vfork()) == 0) { + if ((pid = fork()) == 0) { close(pfd[0]); /* connect stderr to pipe */ if (pfd[1] != 2) { dup2(pfd[1], 2); @@ -232,7 +231,7 @@ int fd; { char errbuf[BUFSIZ]; int nr; - register PROC *pp; + register NETPROC *pp; /* look up associated process */ if ((pp = pindex[fd]) == NULL) abort(); /* serious consistency error */ @@ -286,7 +285,7 @@ PSERVER *ps; int pn; int status; { - register PROC *pp; + register NETPROC *pp; pp = ps->proc + pn; if (pp->cf != NULL) /* client cleanup */