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

Comparing ray/src/util/rpiece.c (file contents):
Revision 2.5 by greg, Fri Aug 7 11:05:30 1992 UTC vs.
Revision 2.6 by greg, Fri Aug 7 11:34:27 1992 UTC

# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10  
11   #include "standard.h"
12   #include <fcntl.h>
13 + #include <signal.h>
14   #include "color.h"
15   #include "view.h"
16   #include "resolu.h"
# Line 35 | Line 36 | int  verbose = 0;
36  
37   extern long  lseek(), ftell();
38  
39 + int  gotalrm = 0;
40 + int  onalrm() { gotalrm++; }
41  
42 +
43   main(argc, argv)
44   int  argc;
45   char  *argv[];
# Line 184 | Line 188 | char  **av;
188                  fprintf(stderr, "%s: out of memory\n", progname);
189                  exit(1);
190          }
191 +        signal(SIGALRM, onalrm);
192          return;
193   filerr:
194          fprintf(stderr, "%s: file i/o error\n", outfile);
# Line 199 | Line 204 | int  *xp, *yp;
204          struct flock  fls;
205          char  buf[64];
206  
207 <        if (syncfd != -1) {             /* using sync file */
207 >        if (gotalrm)                    /* someone wants us to quit */
208 >                return(0);
209 >        if (syncfd != -1) {             /* use sync file */
210                  fls.l_type = F_WRLCK;           /* gain exclusive access */
211                  fls.l_whence = 0;
212                  fls.l_start = 0L;
# Line 225 | Line 232 | int  *xp, *yp;
232                  fcntl(syncfd, F_SETLKW, &fls);
233                  return(1);
234          }
235 <        if (fgets(buf, sizeof(buf), stdin) == NULL)     /* using stdin */
235 >        if (fgets(buf, sizeof(buf), stdin) == NULL)     /* use stdin */
236                  return(0);
237          if (sscanf(buf, "%d %d", xp, yp) == 2)
238                  return(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines