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

Neil Schemenauer nascheme@users.sourceforge.net
2002年3月24日 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);
+ 	}
 }

AltStyle によって変換されたページ (->オリジナル) /