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.13 by greg, Thu Nov 12 10:13:35 1992 UTC vs.
Revision 2.16 by greg, Fri Jan 29 11:56:09 1993 UTC

# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10  
11   #include "standard.h"
12   #include <fcntl.h>
13 +
14 + #ifndef F_SETLKW
15 +
16 + main(argc, argv)
17 + int argc;
18 + char *argv[];
19 + {
20 +        fprintf(stderr, "%s: no NFS lock manager on this machine\n", argv[0]);
21 +        exit(1);
22 + }
23 +
24 + #else
25 +
26   #include <signal.h>
27   #include "color.h"
28   #include "view.h"
# Line 109 | Line 122 | char  *argv[];
122                          case 'F':               /* syncronization file */
123                                  if (argv[i][2])
124                                          break;
125 <                                if ((syncfd = open(argv[++i], O_RDWR)) < 0) {
125 >                                if ((syncfd = open(argv[++i],
126 >                                                O_RDWR|O_CREAT, 0666)) < 0) {
127                                          fprintf(stderr, "%s: cannot open\n",
128                                                          argv[i]);
129                                          exit(1);
130                                  }
131                                  continue;
132 +                        case 'z':               /* z-file ist verbotten */
133 +                                fprintf(stderr, "%s: -z option not allowed\n",
134 +                                                argv[0]);
135 +                                exit(1);
136                          case 'o':               /* output file */
137                                  if (argv[i][2])
138                                          break;
# Line 130 | Line 148 | char  *argv[];
148          }
149          init(argc, argv);
150          rpiece();
151 <        rval = cleanup(0);
134 <        exit(rval);
151 >        exit(cleanup(0));
152   }
153  
154  
# Line 172 | Line 189 | char  **av;
189                  if ((fp = fdopen(dup(outfd), "r+")) == NULL)
190                          goto filerr;
191                  getheader(fp, NULL, NULL);      /* skip header */
192 <                if (fscnresolu(&hr, &vr, fp) < 0 ||     /* check resolution */
192 >                if (!fscnresolu(&hr, &vr, fp) ||        /* check resolution */
193                                  hr != hres*hmult || vr != vres*vmult) {
194                          fprintf(stderr, "%s: resolution mismatch on file \"%s\"\n",
195                                          progname, outfile);
# Line 335 | Line 352 | int  xpos, ypos;
352          }
353                                  /* check header from rpict */
354          getheader(fromrp, NULL, NULL);
355 <        if (fscnresolu(&hr, &vr, fromrp) < 0 || hr != hres | vr != vres) {
355 >        if (!fscnresolu(&hr, &vr, fromrp) || hr != hres | vr != vres) {
356                  fprintf(stderr, "%s: resolution mismatch from %s\n",
357                                  progname, rpargv[0]);
358                  exit(cleanup(1));
# Line 361 | Line 378 | int  xpos, ypos;
378   #else
379          pid = -1;               /* no forking */
380   #endif
381 +        fls.l_len = (long)vres*hmult*hres*sizeof(COLR);
382 +        fls.l_start = scanorig + (vmult-1-ypos)*fls.l_len;
383   #if NFS
384                                  /* lock file section so NFS doesn't mess up */
385          fls.l_whence = 0;
367        fls.l_len = (long)vres*hmult*hres*sizeof(COLR);
368        fls.l_start = scanorig + (vmult-1-ypos)*fls.l_len;
386          fls.l_type = F_WRLCK;
387          fcntl(outfd, F_SETLKW, &fls);
388   #endif
# Line 401 | Line 418 | writerr:
418          fprintf(stderr, "%s: write error on file \"%s\"\n", progname, outfile);
419          _exit(1);
420   }
421 +
422 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines