Changeset 391 for python/trunk/Modules/sgimodule.c
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Modules/sgimodule.c
r2 r391 11 11 sgi_nap(PyObject *self, PyObject *args) 12 12 { 13 14 15 16 17 18 19 20 13 long ticks; 14 if (!PyArg_ParseTuple(args, "l:nap", &ticks)) 15 return NULL; 16 Py_BEGIN_ALLOW_THREADS 17 sginap(ticks); 18 Py_END_ALLOW_THREADS 19 Py_INCREF(Py_None); 20 return Py_None; 21 21 } 22 22 … … 26 26 sgi__getpty(PyObject *self, PyObject *args) 27 27 { 28 29 30 31 32 33 34 35 36 37 38 39 40 41 28 int oflag; 29 int mode; 30 int nofork; 31 char *name; 32 int fildes; 33 if (!PyArg_ParseTuple(args, "iii:_getpty", &oflag, &mode, &nofork)) 34 return NULL; 35 errno = 0; 36 name = _getpty(&fildes, oflag, (mode_t)mode, nofork); 37 if (name == NULL) { 38 PyErr_SetFromErrno(PyExc_IOError); 39 return NULL; 40 } 41 return Py_BuildValue("(si)", name, fildes); 42 42 } 43 43 44 44 static PyMethodDef sgi_methods[] = { 45 {"nap", sgi_nap,METH_VARARGS},46 {"_getpty", sgi__getpty,METH_VARARGS},47 {NULL, NULL}/* sentinel */45 {"nap", sgi_nap, METH_VARARGS}, 46 {"_getpty", sgi__getpty, METH_VARARGS}, 47 {NULL, NULL} /* sentinel */ 48 48 }; 49 49 … … 52 52 initsgi(void) 53 53 { 54 54 Py_InitModule("sgi", sgi_methods); 55 55 }
Note:
See TracChangeset
for help on using the changeset viewer.