diff options
author | Matt Wilson <msw@redhat.com> | 2000-06-10 03:12:54 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-06-10 03:12:54 +0000 |
commit | 7cc44abfbdd4f9269b2874b3c8e3f0d17c3ec36d (patch) | |
tree | 06d327b0b73aa29a65abcb3c3b89051459ce85ef /isys/isys.c | |
parent | 56ebd9e4f723f00fb9e1babced2f701e3025a6bc (diff) | |
download | anaconda-7cc44abfbdd4f9269b2874b3c8e3f0d17c3ec36d.tar.gz anaconda-7cc44abfbdd4f9269b2874b3c8e3f0d17c3ec36d.tar.xz anaconda-7cc44abfbdd4f9269b2874b3c8e3f0d17c3ec36d.zip |
add changevt call
Diffstat (limited to 'isys/isys.c')
-rw-r--r-- | isys/isys.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c index 268f745df..8b35e93f8 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -25,6 +25,7 @@ #include <pump.h> #include <scsi/scsi.h> #include <scsi/scsi_ioctl.h> +#include <sys/vt.h> #include "Python.h" @@ -83,6 +84,7 @@ static PyObject * doExt2Dirty(PyObject * s, PyObject * args); static PyObject * doIsScsiRemovable(PyObject * s, PyObject * args); static PyObject * doIsIdeRemovable(PyObject * s, PyObject * args); static PyObject * doEjectCdrom(PyObject * s, PyObject * args); +static PyObject * doVtActivate(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -127,6 +129,7 @@ static PyMethodDef isysModuleMethods[] = { { "loadKeymap", (PyCFunction) doLoadKeymap, METH_VARARGS, NULL }, { "isScsiRemovable", (PyCFunction) doIsScsiRemovable, METH_VARARGS, NULL}, { "isIdeRemovable", (PyCFunction) doIsIdeRemovable, METH_VARARGS, NULL}, + { "vtActivate", (PyCFunction) doVtActivate, METH_VARARGS, NULL}, { NULL } } ; @@ -1320,3 +1323,18 @@ static PyObject * doEjectCdrom(PyObject * s, PyObject * args) { Py_INCREF(Py_None); return Py_None; } + +static PyObject * doVtActivate(PyObject * s, PyObject * args) { + int vtnum; + + if (!PyArg_ParseTuple(args, "i", &vtnum)) return NULL; + + if (ioctl(0, VT_ACTIVATE, vtnum)) { + PyErr_SetFromErrno(PyExc_SystemError); + return NULL; + } + + Py_INCREF(Py_None); + return Py_None; +} + |