14 |
|
#include "paths.h" |
15 |
|
#include <signal.h> |
16 |
|
#include <sys/types.h> |
17 |
+ |
#include <sys/select.h> |
18 |
|
#include <sys/stat.h> |
19 |
|
/* select call compatibility stuff */ |
20 |
|
#ifndef FD_SETSIZE |
139 |
|
sprintf(buf, "%s %d\n%s\n%s\n%s\n", progname, getpid(), |
140 |
|
inpname, outpname, errname); |
141 |
|
n = strlen(buf); |
141 |
– |
lseek(persistfd, 0L, 0); |
142 |
|
if (write(persistfd, buf, n) < n) |
143 |
|
error(SYSTEM, "error writing persist file"); |
144 |
+ |
lseek(persistfd, 0L, 0); |
145 |
|
/* wait TIMELIM for someone to signal us */ |
146 |
|
got_io = 0; |
147 |
|
signal(SIGIO, sig_io); |
266 |
|
goto readerr; |
267 |
|
if (nr == 0) { |
268 |
|
close(fderr); |
269 |
< |
close(2); |
269 |
> |
/* close(2); don't close stderr! */ |
270 |
|
fderr = -1; |
271 |
|
} else |
272 |
|
do { /* write it all */ |