svn commit: r202070 - head/usr.bin/make

Harti Brandt hartmut.brandt at
Mon Jan 11 17:31:08 UTC 2010


On Mon, 11 Jan 2010, Andrey Chernov wrote:

AC>On Mon, Jan 11, 2010 at 09:16:42AM +0000, Hartmut Brandt wrote:
AC>> @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev
AC>>  		} else {
AC>>  			fprintf(stdout, "Remaking `%s'\n", gn->name);
AC>>  			fflush(stdout);
AC>> -			if ((tdir = getenv("TMPDIR")) == NULL)
AC>> -				tdir = TMPDIR;
AC>>  			snprintf(job->outFile, sizeof(job->outFile), "%s/%s",
AC>>  			    tdir, TMPPAT);
AC>>  			if ((job->outFd = mkstemp(job->outFile)) == -1)
AC>With the presence of .EXPORTVAR directive (setenv() called) TMPDIR 
AC>environment can be changed on the fly, so perhaps this lines are for reason.

There is the same getenv() just a couple of lines above of all the if()s 
so that it covers both uses of tdir. I just though that doing the getenv() 
in both places is slightly more performing that do it all the time. But 
decided that this gain would be clearly below noise level. The I forgot to 
remove the now unneeded second getenv.


More information about the svn-src-head mailing list