| 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; |