--- ray/src/px/pcomb.c 1992/08/28 21:41:49 2.5 +++ ray/src/px/pcomb.c 1992/09/08 10:35:05 2.6 @@ -1,4 +1,4 @@ -/* Copyright (c) 1991 Regents of the University of California */ +/* Copyright (c) 1992 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -34,6 +34,7 @@ struct { int nfiles; /* number of input files */ +char Command[] = ""; char vcolin[3][4] = {"ri", "gi", "bi"}; char vcolout[3][4] = {"ro", "go", "bo"}; char vbrtin[] = "li"; @@ -125,7 +126,7 @@ char *argv[]; } else { if (argv[a][0] == '!') { - input[nfiles].name = ""; + input[nfiles].name = Command; input[nfiles].fp = popen(argv[a]+1, "r"); } else { input[nfiles].name = argv[a]; @@ -453,29 +454,15 @@ char *msg; } -#ifdef NIX - -quit(code) -int code; -{ - exit(code); -} - -#else - quit(code) /* exit gracefully */ int code; { - int status; register int i; /* close input files */ for (i = 0; i < nfiles; i++) - fclose(input[i].fp); - /* reap children */ - while (wait(&status) != -1) - if (code == 0) - code = status>>8 & 0xff; + if (input[i].name == Command) + pclose(input[i].fp); + else + fclose(input[i].fp); exit(code); } - -#endif