1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
159 |
|
n = odev.ifd+1; |
160 |
|
if (sstdin != NULL) { |
161 |
|
FD_SET(fileno(sstdin), &readset); |
162 |
+ |
FD_SET(fileno(sstdin), &errset); |
163 |
|
if (fileno(sstdin) >= n) |
164 |
|
n = fileno(sstdin) + 1; |
165 |
|
} |
174 |
|
flgs |= RDY_SRV; |
175 |
|
if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset)) |
176 |
|
flgs |= RDY_DEV; |
177 |
< |
if (sstdin != NULL && FD_ISSET(fileno(sstdin), &readset)) |
177 |
> |
if (sstdin != NULL && (FD_ISSET(fileno(sstdin), &readset) || |
178 |
> |
FD_ISSET(fileno(sstdin), &errset))) |
179 |
|
flgs |= RDY_SIN; |
180 |
|
return(flgs); |
181 |
|
} |
283 |
|
usr_input() /* get user input and process it */ |
284 |
|
{ |
285 |
|
VIEW vparams; |
286 |
< |
char cmd[128]; |
286 |
> |
char cmd[256]; |
287 |
|
register char *args; |
288 |
|
register int i; |
289 |
|
|
290 |
< |
if (fgets(cmd, sizeof(cmd), sstdin) == NULL) |
291 |
< |
return(DC_QUIT); |
290 |
> |
if (fgets(cmd, sizeof(cmd), sstdin) == NULL) { |
291 |
> |
fclose(sstdin); |
292 |
> |
sstdin = NULL; |
293 |
> |
return(0); |
294 |
> |
} |
295 |
|
for (args = cmd; *args && !isspace(*args); args++) |
296 |
|
; |
297 |
|
while (isspace(*args)) |