--- ray/src/util/rttree_reduce.c 2013/10/03 03:36:11 2.8 +++ ray/src/util/rttree_reduce.c 2014/03/17 01:59:48 2.9 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rttree_reduce.c,v 2.8 2013/10/03 03:36:11 greg Exp $"; +static const char RCSid[] = "$Id: rttree_reduce.c,v 2.9 2014/03/17 01:59:48 greg Exp $"; #endif /* * A utility called by genBSDF.pl to reduce tensor tree samples and output @@ -364,12 +364,15 @@ main(int argc, char *argv[]) if (i < argc-1) goto userr; /* load input data */ - if (i == argc-1 && freopen(argv[i], "rb", stdin) == NULL) { + if (i == argc-1 && freopen(argv[i], "r", stdin) == NULL) { sprintf(errmsg, "cannot open input file '%s'", argv[i]); error(SYSTEM, errmsg); } if (infmt != 'a') SET_FILE_BINARY(stdin); +#ifdef getc_unlocked /* avoid lock/unlock overhead */ + flockfile(stdin); +#endif load_data(); if (recipavg) do_reciprocity();