[61770] trunk/base/src/pextlib1.0/filemap.c

Ryan Schmidt ryandesign at macports.org
Sun Dec 20 22:31:33 PST 2009


On Dec 21, 2009, at 00:21, jmr at macports.org wrote:

> Revision: 61770
>          http://trac.macports.org/changeset/61770
> Author:   jmr at macports.org
> Date:     2009-12-20 22:21:07 -0800 (Sun, 20 Dec 2009)
> Log Message:
> -----------
> fix fd leak (#22959)

I'm impressed you were able to find this! How'd you do that? :) And why does this change fix the problem?


> Modified Paths:
> --------------
>    trunk/base/src/pextlib1.0/filemap.c
> 
> Modified: trunk/base/src/pextlib1.0/filemap.c
> ===================================================================
> --- trunk/base/src/pextlib1.0/filemap.c	2009-12-21 05:14:02 UTC (rev 61769)
> +++ trunk/base/src/pextlib1.0/filemap.c	2009-12-21 06:21:07 UTC (rev 61770)
> @@ -210,7 +210,7 @@
> 		ssize_t theFileSize;
> 
> 		/* Open the file for reading, creating it if necessary. */
> -		int theFD = open(inDatabasePath, O_RDONLY | O_CREAT, 0664);
> +		theFD = open(inDatabasePath, O_RDONLY | O_CREAT, 0664);
> 		if (theFD < 0)
> 		{
> 			theErr = errno;





More information about the macports-dev mailing list