ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/persist.c
(Generate patch)

Comparing ray/src/rt/persist.c (file contents):
Revision 2.1 by greg, Wed Jan 20 15:19:00 1993 UTC vs.
Revision 2.2 by greg, Thu Jan 21 10:09:04 1993 UTC

# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
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 */
# Line 83 | Line 87 | char   *pfn;
87   }
88  
89  
90 < sig_noop() {}
90 > int sig_noop() {}
91  
92  
93   pfhold()                /* holding pattern for idle rendering process */
# Line 105 | Line 109 | pfhold()               /* holding pattern for idle rendering proces
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)
# Line 155 | Line 162 | io_process()           /* just act as conduits to and from actu
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines