18 |
|
|
19 |
|
static int inp_flags; |
20 |
|
static int dpd[3]; |
21 |
– |
static int pipesiz; |
21 |
|
static FILE *dpout; |
22 |
|
|
23 |
|
|
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"); |
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(); |
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 |
|
} |
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 |
|
|
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); |