summaryrefslogtreecommitdiffstats
path: root/isys/isys.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-11-17 17:37:11 +0000
committerErik Troan <ewt@redhat.com>2000-11-17 17:37:11 +0000
commitf942fb8a5541db5a2ae383fa4a5d7e5388cdf34e (patch)
treead78eda7b08cb7fb6cbb39f457caa619f8c5d879 /isys/isys.c
parent514ad7cda7019e35fd9fe94f0cb28d8462715092 (diff)
downloadanaconda-f942fb8a5541db5a2ae383fa4a5d7e5388cdf34e.tar.gz
anaconda-f942fb8a5541db5a2ae383fa4a5d7e5388cdf34e.tar.xz
anaconda-f942fb8a5541db5a2ae383fa4a5d7e5388cdf34e.zip
added code to check to see if a file is an iso image
Diffstat (limited to 'isys/isys.c')
-rw-r--r--isys/isys.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/isys/isys.c b/isys/isys.c
index 723633f43..67ad778da 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -88,6 +88,7 @@ static PyObject * doEjectCdrom(PyObject * s, PyObject * args);
static PyObject * doVtActivate(PyObject * s, PyObject * args);
static PyObject * doisPsudoTTY(PyObject * s, PyObject * args);
static PyObject * doSync(PyObject * s, PyObject * args);
+static PyObject * doisIsoImage(PyObject * s, PyObject * args);
static PyMethodDef isysModuleMethods[] = {
{ "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL },
@@ -135,6 +136,7 @@ static PyMethodDef isysModuleMethods[] = {
{ "vtActivate", (PyCFunction) doVtActivate, METH_VARARGS, NULL},
{ "isPsudoTTY", (PyCFunction) doisPsudoTTY, METH_VARARGS, NULL},
{ "sync", (PyCFunction) doSync, METH_VARARGS, NULL},
+ { "isisoimage", (PyCFunction) doisIsoImage, METH_VARARGS, NULL},
{ NULL }
} ;
@@ -1387,7 +1389,6 @@ static PyObject * doisPsudoTTY(PyObject * s, PyObject * args) {
static PyObject * doSync(PyObject * s, PyObject * args) {
int fd;
- struct stat sb;
if (!PyArg_ParseTuple(args, "", &fd)) return NULL;
sync();
@@ -1395,3 +1396,15 @@ static PyObject * doSync(PyObject * s, PyObject * args) {
Py_INCREF(Py_None);
return Py_None;
}
+
+static PyObject * doisIsoImage(PyObject * s, PyObject * args) {
+ char * fn;
+ int rc;
+
+ if (!PyArg_ParseTuple(args, "s", &fn)) return NULL;
+ /* ! returns proper true/false */
+ rc = !fileIsIso(fn);
+
+ return Py_BuildValue("i", rc);
+}
+int fileIsIso(const char * file);