[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.148,2.149
Fredrik Lundh
python-dev@python.org
Mon, 10 Jul 2000 08:59:33 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv21665/Modules
Modified Files:
posixmodule.c
Log Message:
-- get rid of a compiler warning on unix. (as reported
for #100836, but implemented in a different way)
Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.148
retrieving revision 2.149
diff -C2 -r2.148 -r2.149
*** posixmodule.c 2000/07/09 23:35:24 2.148
--- posixmodule.c 2000/07/10 15:59:30 2.149
***************
*** 513,536 ****
}
- static PyObject *
- posix_strintint(PyObject *args, char *format,
- int (*func)(const char *, int, int))
- {
- char *path;
- int i,i2;
- int res;
- if (!PyArg_ParseTuple(args, format, &path, &i, &i2))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
- res = (*func)(path, i, i2);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error_with_filename(path);
- Py_INCREF(Py_None);
- return Py_None;
- }
-
-
/* pack a system stat C structure into the Python stat tuple
(used by posix_stat() and posix_fstat()) */
--- 513,517 ----
***************
*** 769,773 ****
! #ifdef HAVE_CHOWN
static char posix_chown__doc__[] =
"chown(path, uid, gid) -> None\n\
--- 750,754 ----
! #if HAVE_CHOWN
static char posix_chown__doc__[] =
"chown(path, uid, gid) -> None\n\
***************
*** 777,781 ****
posix_chown(PyObject *self, PyObject *args)
{
! return posix_strintint(args, "sii:chown", chown);
}
#endif /* HAVE_CHOWN */
--- 758,773 ----
posix_chown(PyObject *self, PyObject *args)
{
! char *path;
! int uid, gid;
! int res;
! if (!PyArg_ParseTuple(args, "sii:chown", &path, &uid, &gid))
! return NULL;
! Py_BEGIN_ALLOW_THREADS
! res = chown(path, (uid_t) uid, (gid_t) gid);
! Py_END_ALLOW_THREADS
! if (res < 0)
! return posix_error_with_filename(path);
! Py_INCREF(Py_None);
! return Py_None;
}
#endif /* HAVE_CHOWN */