| 11 |
|
#include <signal.h> |
| 12 |
|
#include <fcntl.h> |
| 13 |
|
#include <unistd.h> |
| 14 |
+ |
#include <sys/wait.h> |
| 15 |
|
|
| 16 |
+ |
#include "rtmisc.h" |
| 17 |
|
#include "selcall.h" |
| 18 |
|
#include "netproc.h" |
| 19 |
|
#include "paths.h" |
| 32 |
|
|
| 33 |
|
extern char *remsh; /* externally defined remote shell program */ |
| 34 |
|
|
| 35 |
+ |
static int readerrs(int fd); |
| 36 |
+ |
static void wait4end(void); |
| 37 |
+ |
static int finishjob(PSERVER *ps, int pn, int status); |
| 38 |
|
|
| 39 |
< |
PSERVER * |
| 40 |
< |
addpserver(host, dir, usr, np) /* add a new process server */ |
| 41 |
< |
char *host, *dir, *usr; |
| 42 |
< |
int np; |
| 39 |
> |
|
| 40 |
> |
extern PSERVER * |
| 41 |
> |
addpserver( /* add a new process server */ |
| 42 |
> |
char *host, |
| 43 |
> |
char *dir, |
| 44 |
> |
char *usr, |
| 45 |
> |
int np |
| 46 |
> |
) |
| 47 |
|
{ |
| 48 |
|
register PSERVER *ps; |
| 49 |
|
/* allocate the struct */ |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
|
| 115 |
< |
delpserver(ps) /* delete a process server */ |
| 116 |
< |
PSERVER *ps; |
| 115 |
> |
extern void |
| 116 |
> |
delpserver( /* delete a process server */ |
| 117 |
> |
PSERVER *ps |
| 118 |
> |
) |
| 119 |
|
{ |
| 120 |
|
PSERVER pstart; |
| 121 |
|
register PSERVER *psp; |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
|
| 141 |
< |
PSERVER * |
| 142 |
< |
findjob(pnp) /* find out where process is running */ |
| 143 |
< |
register int *pnp; /* modified */ |
| 141 |
> |
extern PSERVER * |
| 142 |
> |
findjob( /* find out where process is running */ |
| 143 |
> |
register int *pnp /* modified */ |
| 144 |
> |
) |
| 145 |
|
{ |
| 146 |
|
register PSERVER *ps; |
| 147 |
|
register int i; |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
|
| 159 |
< |
int |
| 160 |
< |
startjob(ps, command, compf) /* start a job on a process server */ |
| 161 |
< |
register PSERVER *ps; |
| 162 |
< |
char *command; |
| 163 |
< |
int (*compf)(); |
| 159 |
> |
extern int |
| 160 |
> |
startjob( /* start a job on a process server */ |
| 161 |
> |
register PSERVER *ps, |
| 162 |
> |
char *command, |
| 163 |
> |
pscompfunc *compf |
| 164 |
> |
) |
| 165 |
|
{ |
| 166 |
|
char udirt[PATH_MAX]; |
| 167 |
|
char *av[16]; |
| 239 |
|
|
| 240 |
|
|
| 241 |
|
static int |
| 242 |
< |
readerrs(fd) /* read error output from fd */ |
| 243 |
< |
int fd; |
| 242 |
> |
readerrs( /* read error output from fd */ |
| 243 |
> |
int fd |
| 244 |
> |
) |
| 245 |
|
{ |
| 246 |
|
char errbuf[BUFSIZ]; |
| 247 |
|
int nr; |
| 271 |
|
} |
| 272 |
|
|
| 273 |
|
|
| 274 |
< |
static |
| 275 |
< |
wait4end() /* read error streams until someone is done */ |
| 274 |
> |
static void |
| 275 |
> |
wait4end(void) /* read error streams until someone is done */ |
| 276 |
|
{ |
| 277 |
|
fd_set readfds, excepfds; |
| 278 |
|
register int i; |
| 294 |
|
|
| 295 |
|
|
| 296 |
|
static int |
| 297 |
< |
finishjob(ps, pn, status) /* clean up finished process */ |
| 298 |
< |
PSERVER *ps; |
| 299 |
< |
int pn; |
| 300 |
< |
int status; |
| 297 |
> |
finishjob( /* clean up finished process */ |
| 298 |
> |
PSERVER *ps, |
| 299 |
> |
int pn, |
| 300 |
> |
int status |
| 301 |
> |
) |
| 302 |
|
{ |
| 303 |
|
register NETPROC *pp; |
| 304 |
|
|
| 319 |
|
} |
| 320 |
|
|
| 321 |
|
|
| 322 |
< |
int |
| 323 |
< |
wait4job(ps, pid) /* wait for process to finish */ |
| 324 |
< |
PSERVER *ps; |
| 325 |
< |
int pid; |
| 322 |
> |
extern int |
| 323 |
> |
wait4job( /* wait for process to finish */ |
| 324 |
> |
PSERVER *ps, |
| 325 |
> |
int pid |
| 326 |
> |
) |
| 327 |
|
{ |
| 328 |
|
int status, psn, psn2; |
| 329 |
|
PSERVER *ps2; |