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

Comparing ray/src/hd/rholo4.c (file contents):
Revision 3.5 by gregl, Mon Nov 10 18:07:15 1997 UTC vs.
Revision 3.7 by gregl, Thu Nov 20 18:07:00 1997 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ SGI";
18  
19   static int      inp_flags;
20   static int      dpd[3];
21 static int      pipesiz;
21   static FILE     *dpout;
22  
23  
# Line 34 | Line 33 | char   *dname;
33          sprintf(dpath, "dev/%s%s", dname, HDSUF);
34   #endif
35          com[0] = dpath; com[1] = froot; com[2] = NULL;
36 <        pipesiz = open_process(dpd, com);
37 <        if (pipesiz <= 0)
36 >        i = open_process(dpd, com);
37 >        if (i <= 0)
38                  error(USER, "cannot start display process");
39          if ((dpout = fdopen(dup(dpd[1]), "w")) == NULL)
40                  error(SYSTEM, "cannot associate FILE with display pipe");
# Line 61 | Line 60 | int    block;
60          int     n;
61          char    *buf = NULL;
62  
63 <        if (pipesiz <= 0)
63 >        if (dpout == NULL)
64                  return(-1);
65                                          /* flush display output */
66          disp_flush();
# Line 126 | Line 125 | int    block;
125                  if (msg.nbytes)
126                          error(INTERNAL, "bad DR_SHUTDOWN from display process");
127                  return(0);              /* zero return signals shutdown */
128 +        case DR_NOOP:
129 +                break;
130          default:
131                  error(INTERNAL, "unrecognized request from display process");
132          }
# Line 144 | Line 145 | disp_close()                   /* close our display process */
145   {
146          int     rval;
147  
148 <        if (pipesiz <= 0)
148 >        if (dpout == NULL)
149                  return(-1);
150          disp_result(DS_SHUTDOWN, 0, NULL);
151          fclose(dpout);
152          dpout = NULL;
152        pipesiz = 0;
153          return(close_process(dpd));
154   }
155  
# Line 160 | Line 160 | char   *p;
160   {
161          MSGHEAD msg;
162  
163 +        if (dpout == NULL)
164 +                return;
165          msg.type = type;
166          msg.nbytes = nbytes;
167          fwrite((char *)&msg, sizeof(MSGHEAD), 1, dpout);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines