--- ray/src/rt/rc2.c 2019/08/14 20:07:20 2.23 +++ ray/src/rt/rc2.c 2023/04/07 00:03:26 2.25 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rc2.c,v 2.23 2019/08/14 20:07:20 greg Exp $"; +static const char RCSid[] = "$Id: rc2.c,v 2.25 2023/04/07 00:03:26 greg Exp $"; #endif /* * Accumulate ray contributions for a set of materials @@ -143,11 +143,15 @@ getostream(const char *ospec, const char *mname, int b LUENT *lep; STREAMOUT *sop; char *cp; - + + info[0] = '\0'; if (ospec == NULL) { /* use stdout? */ if (!noopen & !using_stdout) { if (outfmt != 'a') SET_FILE_BINARY(stdout); +#ifdef getc_unlocked + flockfile(stdout); /* avoid lock/unlock overhead */ +#endif if (header) { cp = info; if (yres > 0) { @@ -164,9 +168,6 @@ getostream(const char *ospec, const char *mname, int b if (waitflush > 0) fflush(stdout); stdos.xr = xres; stdos.yr = yres; -#ifdef getc_unlocked - flockfile(stdout); /* avoid lock/unlock overhead */ -#endif using_stdout = 1; } stdos.ofp = stdout;