Kaydet (Commit) 55db515a authored tarafından Guido van Rossum's avatar Guido van Rossum

Great renaming.

Also got rid of the dummy variable, which was last needed in IRIX 4.x.
üst 09f99dfd
...@@ -31,55 +31,52 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -31,55 +31,52 @@ PERFORMANCE OF THIS SOFTWARE.
/* SGI module -- random SGI-specific things */ /* SGI module -- random SGI-specific things */
#include "allobjects.h" #include "Python.h"
#include "modsupport.h"
#include "ceval.h"
#include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
static object * static PyObject *
sgi_nap(self, args) sgi_nap(self, args)
object *self; PyObject *self;
object *args; PyObject *args;
{ {
long ticks; long ticks;
if (!getargs(args, "l", &ticks)) if (!PyArg_Parse(args, "l", &ticks))
return NULL; return NULL;
BGN_SAVE Py_BEGIN_ALLOW_THREADS
sginap(ticks); sginap(ticks);
END_SAVE Py_END_ALLOW_THREADS
INCREF(None); Py_INCREF(Py_None);
return None; return Py_None;
} }
extern char *_getpty(int *, int, mode_t, int); extern char *_getpty(int *, int, mode_t, int);
static object * static PyObject *
sgi__getpty(self, args) sgi__getpty(self, args)
object *self; PyObject *self;
object *args; PyObject *args;
{ {
int oflag; int oflag;
int mode; int mode;
int nofork; int nofork;
char *name; char *name;
int fildes; int fildes;
if (!getargs(args, "(iii)", &oflag, &mode, &nofork)) if (!PyArg_Parse(args, "(iii)", &oflag, &mode, &nofork))
return NULL; return NULL;
errno = 0; errno = 0;
name = _getpty(&fildes, oflag, (mode_t)mode, nofork); name = _getpty(&fildes, oflag, (mode_t)mode, nofork);
if (name == NULL) { if (name == NULL) {
err_errno(IOError); PyErr_SetFromErrno(PyExc_IOError);
return NULL; return NULL;
} }
return mkvalue("(si)", name, fildes); return Py_BuildValue("(si)", name, fildes);
} }
static struct methodlist sgi_methods[] = { static PyMethodDef sgi_methods[] = {
{"nap", sgi_nap}, {"nap", sgi_nap},
{"_getpty", sgi__getpty}, {"_getpty", sgi__getpty},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
...@@ -89,8 +86,5 @@ static struct methodlist sgi_methods[] = { ...@@ -89,8 +86,5 @@ static struct methodlist sgi_methods[] = {
void void
initsgi() initsgi()
{ {
initmodule("sgi", sgi_methods); Py_InitModule("sgi", sgi_methods);
} }
int _Py_sgi_dummy; /* $%#@!& dl wants at least a byte of bss */
/* And gcc -Wall doesn't like unused static variables :-( */
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