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

Martin v. L?wis loewis@users.sourceforge.net
Sat, 16 Feb 2002 15:33:25 -0800


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

Modified Files:
	posixmodule.c 
Log Message:
Patch #511193: Implement killpg in posixmodule.


Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.221
retrieving revision 2.222
diff -C2 -d -r2.221 -r2.222
*** posixmodule.c	1 Feb 2002 15:46:29 -0000	2.221
--- posixmodule.c	16 Feb 2002 23:33:23 -0000	2.222
***************
*** 2200,2203 ****
--- 2200,2221 ----
  #endif
  
+ #ifdef HAVE_KILLPG
+ static char posix_killpg__doc__[] =
+ "killpg(pgid, sig) -> None\n\
+ Kill a process group with a signal.";
+ 
+ static PyObject *
+ posix_killpg(PyObject *self, PyObject *args)
+ {
+ 	int pgid, sig;
+ 	if (!PyArg_ParseTuple(args, "ii:killpg", &pgid, &sig))
+ 		return NULL;
+ 	if (killpg(pgid, sig) == -1)
+ 		return posix_error();
+ 	Py_INCREF(Py_None);
+ 	return Py_None;
+ }
+ #endif
+ 
  #ifdef HAVE_PLOCK
  
***************
*** 5574,5577 ****
--- 5592,5598 ----
  	{"kill",	posix_kill, METH_VARARGS, posix_kill__doc__},
  #endif /* HAVE_KILL */
+ #ifdef HAVE_KILLPG
+ 	{"killpg",	posix_killpg, METH_VARARGS, posix_killpg__doc__},
+ #endif /* HAVE_KILLPG */
  #ifdef HAVE_PLOCK
  	{"plock",	posix_plock, METH_VARARGS, posix_plock__doc__},