12 |
|
#include <string.h> |
13 |
|
#include <signal.h> |
14 |
|
#include <sys/stat.h> |
15 |
+ |
#include <sys/types.h> |
16 |
+ |
#ifndef NON_POSIX /* XXX need abstraction for process management */ |
17 |
+ |
#include <sys/wait.h> |
18 |
+ |
#endif |
19 |
|
|
20 |
|
#include "platform.h" |
21 |
|
#include "rtprocess.h" /* getpid() */ |
125 |
|
char buf[512]; |
126 |
|
register int n; |
127 |
|
/* close input and output descriptors */ |
128 |
< |
close(fileno(stdin)); |
129 |
< |
close(fileno(stdout)); |
128 |
> |
close(0); |
129 |
> |
close(1); |
130 |
|
if (errfile == NULL) |
131 |
< |
close(fileno(stderr)); |
131 |
> |
close(2); |
132 |
|
/* create named pipes for input and output */ |
133 |
|
if (mkfifo(mktemp(strcpy(inpname,TEMPLATE)), 0600) < 0) |
134 |
|
goto createrr; |
339 |
|
} while ((nr -= n) > 0); |
340 |
|
} |
341 |
|
} |
342 |
+ |
kill(pid, SIGTERM); /* no more process to feed, so... */ |
343 |
|
waitpid(pid, 0, 0); /* wait for feeder process */ |
344 |
|
_exit(status); |
345 |
|
formerr: |