14 |
|
#include <sys/types.h> |
15 |
|
#include <sys/stat.h> |
16 |
|
|
17 |
+ |
#ifndef TIMELIM |
18 |
+ |
#define TIMELIM (8*3600) /* time limit for holding pattern */ |
19 |
+ |
#endif |
20 |
+ |
|
21 |
|
extern char *strcpy(), *index(); |
22 |
|
|
23 |
|
extern int headismine; /* boolean true if header belongs to me */ |
87 |
|
} |
88 |
|
|
89 |
|
|
90 |
< |
sig_noop() {} |
90 |
> |
int sig_noop() {} |
91 |
|
|
92 |
|
|
93 |
|
pfhold() /* holding pattern for idle rendering process */ |
109 |
|
n = strlen(buf); |
110 |
|
if (write(persistfd, buf, n) < n) |
111 |
|
error(SYSTEM, "error writing persist file in pfhold"); |
112 |
< |
/* wait for someone to signal us */ |
113 |
< |
signal(SIGALRM, sig_noop); |
112 |
> |
/* wait TIMELIM for someone to signal us */ |
113 |
> |
signal(SIGIO, sig_noop); |
114 |
> |
alarm(TIMELIM); |
115 |
|
pflock(0); |
116 |
|
pause(); |
117 |
+ |
alarm(0); |
118 |
+ |
signal(SIGIO, SIG_DFL); |
119 |
|
pflock(1); |
120 |
|
/* someone wants us; reopen stdin and stdout */ |
121 |
|
if (freopen(inpname, "r", stdin) == NULL) |
162 |
|
if (cp-buf != nr) |
163 |
|
goto formerr; |
164 |
|
/* wake up rendering process */ |
165 |
< |
if (kill(pid, SIGALRM) < 0) |
165 |
> |
if (kill(pid, SIGIO) < 0) |
166 |
|
error(SYSTEM, "cannot signal rendering process in io_process"); |
167 |
|
pid = fork(); /* fork i/o process */ |
168 |
|
if (pid < 0) |