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"; |
33 |
|
|
34 |
|
int checkthresh = 0; /* check threshold value */ |
35 |
|
|
36 |
+ |
char Command[] = "<Command>"; |
37 |
+ |
char Label[] = "<Label>"; |
38 |
+ |
|
39 |
|
char *progname; |
40 |
|
|
41 |
|
struct { |
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]; |
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; |
368 |
|
} |
369 |
|
|
370 |
|
|
368 |
– |
#ifdef NIX |
369 |
– |
|
370 |
– |
quit(code) |
371 |
– |
int code; |
372 |
– |
{ |
373 |
– |
exit(code); |
374 |
– |
} |
375 |
– |
|
376 |
– |
#else |
377 |
– |
|
378 |
– |
#include <signal.h> |
379 |
– |
|
371 |
|
quit(code) /* exit gracefully */ |
372 |
|
int code; |
373 |
|
{ |
374 |
< |
int status; |
375 |
< |
|
376 |
< |
if (code) { /* abnormal exit -- kill children */ |
377 |
< |
signal(SIGPIPE, SIG_IGN); |
378 |
< |
kill(0, SIGPIPE); |
379 |
< |
} |
380 |
< |
/* reap any children */ |
390 |
< |
while (wait(&status) != -1) |
391 |
< |
if (code == 0) |
392 |
< |
code = status>>8 & 0xff; |
374 |
> |
register int i; |
375 |
> |
/* close input files */ |
376 |
> |
for (i = 0; i < nfile; i++) |
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 |
|
} |
395 |
– |
|
396 |
– |
#endif |