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

Comparing ray/src/common/readobj.c (file contents):
Revision 2.24 by greg, Sat Oct 17 16:39:23 2020 UTC vs.
Revision 2.25 by greg, Tue Feb 7 20:28:16 2023 UTC

# Line 47 | Line 47 | readobj(                               /* read in an object file or stream */
47                  sprintf(errmsg, "cannot open scene file \"%s\"", inpspec);
48                  error(SYSTEM, errmsg);
49          }
50 + #ifdef getc_unlocked                    /* avoid stupid semaphores */
51 +        flockfile(infp);
52 + #endif
53          while ((c = getc(infp)) != EOF) {
54                  if (isspace(c))
55                          continue;
# Line 65 | Line 68 | readobj(                               /* read in an object file or stream */
68                  pclose(infp);
69          else if (infp != stdin)
70                  fclose(infp);
71 + #ifdef getc_unlocked
72 +        else
73 +                funlockfile(infp);
74 + #endif
75          if (nobjects == lastobj) {
76                  sprintf(errmsg, "(%s): empty file", inpspec);
77                  error(WARNING, errmsg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines