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

Comparing ray/src/px/pcompos.c (file contents):
Revision 2.13 by greg, Fri Aug 28 16:29:20 1992 UTC vs.
Revision 2.14 by greg, Tue Sep 8 10:36:22 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 33 | Line 33 | int  labelht = 24;                     /* label height */
33  
34   int  checkthresh = 0;                   /* check threshold value */
35  
36 + char  Command[] = "<Command>";
37 + char  Label[] = "<Label>";
38 +
39   char  *progname;
40  
41   struct {
# Line 170 | Line 173 | getfile:
173                          input[nfile].fp = stdin;
174                  } else {
175                          if (argv[an][0] == '!') {
176 <                                input[nfile].name = "<Command>";
176 >                                input[nfile].name = Command;
177                                  input[nfile].fp = popen(argv[an]+1, "r");
178                          } else {
179                                  input[nfile].name = argv[an];
# Line 222 | Line 225 | getfile:
225                  if (thislabel != NULL) {
226                          if (++nfile >= MAXFILE)
227                                  goto toomany;
228 <                        input[nfile].name = "<Label>";
228 >                        input[nfile].name = Label;
229                          input[nfile].hasmin = input[nfile].hasmax = 0;
230                          input[nfile].xres = input[nfile-1].xres;
231                          input[nfile].yres = labelht;
# Line 365 | Line 368 | err:
368   }
369  
370  
368 #ifdef  NIX
369
370 quit(code)
371 int  code;
372 {
373        exit(code);
374 }
375
376 #else
377
371   quit(code)              /* exit gracefully */
372   int  code;
373   {
374          register int  i;
375                                  /* close input files */
376          for (i = 0; i < nfile; i++)
377 <                fclose(input[i].fp);
378 <                                /* reap any children */
379 <        while (wait(0) != -1)
380 <                ;
377 >                if (input[i].name == Command || input[i].name == Label)
378 >                        pclose(input[i].fp);
379 >                else
380 >                        fclose(input[i].fp);
381          exit(code);
382   }
390
391 #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines