diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-09-28 01:14:12 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-09-28 01:14:12 +0000 |
commit | c5d8fafc07166759ff26cd73f052ad85bf999176 (patch) | |
tree | a56e45d694f862a14f34e65c073154338f4607e1 /isys | |
parent | c6d64ab07c7530920352dbe7fcbceb75f069ee33 (diff) | |
download | anaconda-c5d8fafc07166759ff26cd73f052ad85bf999176.tar.gz anaconda-c5d8fafc07166759ff26cd73f052ad85bf999176.tar.xz anaconda-c5d8fafc07166759ff26cd73f052ad85bf999176.zip |
2004-09-27 Jeremy Katz <katzj@redhat.com>
* isys/isys.py (getGeometry): Remove unused function.
* isys/isys.c (doGetGeometry): Likewise.
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.c | 55 | ||||
-rw-r--r-- | isys/isys.py | 6 |
2 files changed, 0 insertions, 61 deletions
diff --git a/isys/isys.c b/isys/isys.c index c7aa46ebd..b562b635a 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -98,7 +98,6 @@ static PyObject * doisPsudoTTY(PyObject * s, PyObject * args); static PyObject * doisVioConsole(PyObject * s); static PyObject * doSync(PyObject * s, PyObject * args); static PyObject * doisIsoImage(PyObject * s, PyObject * args); -static PyObject * dogetGeometry(PyObject * s, PyObject * args); static PyObject * getFramebufferInfo(PyObject * s, PyObject * args); static PyObject * printObject(PyObject * s, PyObject * args); static PyObject * doGetPageSize(PyObject * s, PyObject * args); @@ -158,7 +157,6 @@ static PyMethodDef isysModuleMethods[] = { { "isVioConsole", (PyCFunction) doisVioConsole, METH_NOARGS, NULL}, { "sync", (PyCFunction) doSync, METH_VARARGS, NULL}, { "isisoimage", (PyCFunction) doisIsoImage, METH_VARARGS, NULL}, - { "getGeometry", (PyCFunction) dogetGeometry, METH_VARARGS, NULL}, { "fbinfo", (PyCFunction) getFramebufferInfo, METH_VARARGS, NULL}, { "getpagesize", (PyCFunction) doGetPageSize, METH_VARARGS, NULL}, { "printObject", (PyCFunction) printObject, METH_VARARGS, NULL}, @@ -1219,59 +1217,6 @@ static PyObject * doisIsoImage(PyObject * s, PyObject * args) { return Py_BuildValue("i", rc); } -static PyObject * dogetGeometry(PyObject * s, PyObject * args) { - int fd; - char *dev; - char cylinders[16], heads[16], sectors[16]; - char errstr[200]; - struct hd_geometry g; - long numsectors; - unsigned int numcylinders; - - if (!PyArg_ParseTuple(args, "s", &dev)) return NULL; - - fd = open(dev, O_RDONLY); - if (fd == -1) { - snprintf(errstr, sizeof(errstr), "could not open device %s", dev); - PyErr_SetString(PyExc_ValueError, errstr); - return NULL; - } - - if (ioctl(fd, HDIO_GETGEO, &g)) { - close(fd); - snprintf(errstr, sizeof(errstr), "HDTIO_GETGEO ioctl() failed on device %s", dev); - PyErr_SetString(PyExc_ValueError, errstr); - return NULL; - } - - - /* never use g.cylinders if all possible - it is truncated */ - if (ioctl(fd, BLKGETSIZE, &numsectors) == 0) { - int sector_size=1; - -#ifdef BLKSSZGET - /* BLKSSZGET only works with kernel >= 2.3.3. */ - struct utsname buf; - - if (uname (&buf) == 0 - && strverscmp (buf.release, "2.3.3") >= 0 - && ioctl(fd, BLKSSZGET, §or_size) == 0) - sector_size /= 512; - else -#endif - numcylinders = numsectors / (g.heads * g.sectors); - numcylinders /= sector_size; - } else { - numcylinders = g.cylinders; - } - - snprintf(cylinders, sizeof(cylinders), "%d", numcylinders); - snprintf(heads, sizeof(heads), "%d", g.heads); - snprintf(sectors, sizeof(sectors), "%d", g.sectors); - - return Py_BuildValue("(sss)", cylinders, heads, sectors); -} - static PyObject * getFramebufferInfo(PyObject * s, PyObject * args) { int fd; struct fb_var_screeninfo fb; diff --git a/isys/isys.py b/isys/isys.py index 18e9dd53c..f07043b34 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -691,12 +691,6 @@ def sync (): def isIsoImage(file): return _isys.isisoimage(file) -def getGeometry(device): - makeDevInode(device, "/tmp/disk") - rc = _isys.getGeometry("/tmp/disk") - os.unlink("/tmp/disk") - return rc - def fbinfo(): return _isys.fbinfo() |