--- ray/src/util/netproc.c 2003/04/23 00:52:34 2.10 +++ ray/src/util/netproc.c 2003/10/27 10:32:06 2.12 @@ -1,13 +1,17 @@ #ifndef lint -static const char RCSid[] = "$Id: netproc.c,v 2.10 2003/04/23 00:52:34 greg Exp $"; +static const char RCSid[] = "$Id: netproc.c,v 2.12 2003/10/27 10:32:06 schorsch Exp $"; #endif /* * Parallel network process handling routines */ +#include #include +#include #include #include +#include + #include "selcall.h" #include "netproc.h" #include "paths.h" @@ -15,10 +19,10 @@ static const char RCSid[] = "$Id: netproc.c,v 2.10 200 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[MAXPATH]; /* our working directory */ +static char ourdir[PATH_MAX]; /* our working directory */ static char ouruser[32]; /* our user name */ static char *ourshell; /* our user's shell */ @@ -27,9 +31,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; @@ -39,16 +41,16 @@ 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 */ - char dirtmp[MAXPATH]; + char dirtmp[PATH_MAX]; register char *cp; register int len; strcpy(ourhost, myhostname()); - getwd(dirtmp); + getcwd(dirtmp, sizeof(dirtmp)); if ((cp = getenv("HOME")) != NULL) { if (!strcmp(cp, dirtmp)) ourdir[0] = '\0'; @@ -149,7 +151,7 @@ register PSERVER *ps; char *command; int (*compf)(); { - char udirt[MAXPATH]; + char udirt[PATH_MAX]; char *av[16]; int pfd[2], pid; register int i; @@ -230,7 +232,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 */ @@ -284,7 +286,7 @@ PSERVER *ps; int pn; int status; { - register PROC *pp; + register NETPROC *pp; pp = ps->proc + pn; if (pp->cf != NULL) /* client cleanup */