[Python-checkins] CVS: python/dist/src/Modules resource.c,2.22,2.23

Neil Schemenauer nascheme@users.sourceforge.net
Sun, 24 Mar 2002 14:27:41 -0800


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

Modified Files:
	resource.c 
Log Message:
Expose RLIM_INFINITY constant.  Closes SF patch 489066.


Index: resource.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/resource.c,v
retrieving revision 2.22
retrieving revision 2.23
diff -C2 -d -r2.22 -r2.23
*** resource.c	14 Feb 2002 06:59:26 -0000	2.22
--- resource.c	24 Mar 2002 22:27:39 -0000	2.23
***************
*** 161,165 ****
  initresource(void)
  {
! 	PyObject *m;
  
  	/* Create the module and add the functions */
--- 161,165 ----
  initresource(void)
  {
! 	PyObject *m, *v;
  
  	/* Create the module and add the functions */
***************
*** 234,236 ****
--- 234,248 ----
  	PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH);
  #endif
+ 
+ #if defined(HAVE_LONG_LONG)
+ 	if (sizeof(RLIM_INFINITY) > sizeof(long)) {
+ 		v = PyLong_FromLongLong((LONG_LONG) RLIM_INFINITY);
+ 	} else 
+ #endif
+ 	{
+ 		v = PyInt_FromLong((long) RLIM_INFINITY);
+ 	}
+ 	if (v) {
+ 		PyModule_AddObject(m, "RLIM_INFINITY", v);
+ 	}
  }