[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.175,2.175.2.1

Moshe Zadka moshez@users.sourceforge.net
Sat, 31 Mar 2001 00:10:05 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv2690/Modules

Modified Files:
      Tag: release20-maint
	posixmodule.c 
Log Message:
- posixmodule.c - Add missing prototypes in for SunOS 4.1.4, plug memory leak

- #125891 - posixmodule.c - os.popen2,3 and 4 leaked file objects on Windows.

- #128053 - posixmodule.c - #ifdef for including "tmpfile" in the
            posix_methods[] array was wrong -- should be HAVE_TMPFILE


Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.175
retrieving revision 2.175.2.1
diff -C2 -r2.175 -r2.175.2.1
*** posixmodule.c	2000/10/03 16:54:24	2.175
--- posixmodule.c	2001/03/31 08:10:03	2.175.2.1
***************
*** 114,117 ****
--- 114,120 ----
  extern int pclose(FILE *);
  extern int fclose(FILE *);
+ extern int fsync(int);
+ extern int lstat(const char *, struct stat *);
+ extern int symlink(const char *, const char *);
  #endif
  
***************
*** 2510,2513 ****
--- 2513,2518 ----
  
  		 f = Py_BuildValue("OO",p1,p2);
+ 		 Py_XDECREF(p1);
+ 		 Py_XDECREF(p2);
  		 file_count = 2;
  		 break;
***************
*** 2540,2543 ****
--- 2545,2551 ----
  		 PyFile_SetBufSize(p3, 0);
  		 f = Py_BuildValue("OOO",p1,p2,p3);
+ 		 Py_XDECREF(p1);
+ 		 Py_XDECREF(p2);
+ 		 Py_XDECREF(p3);
  		 file_count = 3;
  		 break;
***************
*** 5349,5353 ****
  	{"statvfs",	posix_statvfs, METH_VARARGS, posix_statvfs__doc__},
  #endif
! #ifdef HAVE_TMPNAM
  	{"tmpfile",	posix_tmpfile, METH_VARARGS, posix_tmpfile__doc__},
  #endif
--- 5357,5361 ----
  	{"statvfs",	posix_statvfs, METH_VARARGS, posix_statvfs__doc__},
  #endif
! #ifdef HAVE_TMPFILE
  	{"tmpfile",	posix_tmpfile, METH_VARARGS, posix_tmpfile__doc__},
  #endif
***************
*** 5570,5574 ****
  
  #ifdef HAVE_PUTENV
! 	posix_putenv_garbage = PyDict_New();
  #endif
  }
--- 5578,5583 ----
  
  #ifdef HAVE_PUTENV
! 	if (posix_putenv_garbage == NULL)
! 		posix_putenv_garbage = PyDict_New();
  #endif
  }