Commit 32071dcb authored by Jeremy Hylton's avatar Jeremy Hylton

Convert K&R declaration to Std C prototype.

Silence warnings.
Add :name to PyArg_ParseTuple() call.
parent 6cdcac62
...@@ -20,17 +20,15 @@ ...@@ -20,17 +20,15 @@
#include <unistd.h> #include <unistd.h>
static PyObject * static PyObject *
initgroups_initgroups(self, args) initgroups_initgroups(PyObject *self, PyObject *args)
PyObject *self;
PyObject *args;
{ {
char *username; char *username;
gid_t gid; gid_t gid;
if(!PyArg_ParseTuple(args, "sl", &username, &gid)) if (!PyArg_ParseTuple(args, "sl:initgroups", &username, &gid))
return NULL; return NULL;
if(initgroups(username, gid) == -1) if (initgroups(username, gid) == -1)
return PyErr_SetFromErrno(PyExc_OSError); return PyErr_SetFromErrno(PyExc_OSError);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -53,8 +51,8 @@ static PyMethodDef InitgroupsMethods[] = { ...@@ -53,8 +51,8 @@ static PyMethodDef InitgroupsMethods[] = {
#endif /* defined(__unix__) || defined(unix) */ #endif /* defined(__unix__) || defined(unix) */
void void
initinitgroups() initinitgroups(void)
{ {
(void)Py_InitModule("initgroups", InitgroupsMethods); Py_InitModule("initgroups", InitgroupsMethods);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment