summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-04-07 14:32:54 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-04-08 09:11:42 -1000
commit01f71fcc6eca0e0fbd38ed48f8c2d2ea83bebfd1 (patch)
tree44f2035e71bd50aa89ecff08cc03faa4d5d362f1 /isys
parentd108c723a3bef2a6d2b3714a645e8829f8df8f29 (diff)
downloadanaconda-01f71fcc6eca0e0fbd38ed48f8c2d2ea83bebfd1.tar.gz
anaconda-01f71fcc6eca0e0fbd38ed48f8c2d2ea83bebfd1.tar.xz
anaconda-01f71fcc6eca0e0fbd38ed48f8c2d2ea83bebfd1.zip
Run /bin/umount instead of calling umount(2) in _isys.umount (#493333)
Call the umount(8) command when unmounting filesystems through isys so that /etc/mtab is updated.
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/isys/isys.c b/isys/isys.c
index bd68f8fbb..8a83a546b 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -1,7 +1,7 @@
/*
* isys.c
*
- * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009 Red Hat, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +41,6 @@
#undef dev_t
#define dev_t dev_t
#include <sys/ioctl.h>
-#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/time.h>
@@ -262,13 +261,33 @@ static PyObject * doLoSetup(PyObject * s, PyObject * args) {
}
static PyObject * doUMount(PyObject * s, PyObject * args) {
- char * fs;
+ char *err = NULL, *mntpoint = NULL;
+ int rc;
- if (!PyArg_ParseTuple(args, "s", &fs)) return NULL;
+ if (!PyArg_ParseTuple(args, "s", &mntpoint)) {
+ return NULL;
+ }
- if (umount(fs)) {
- PyErr_SetFromErrno(PyExc_SystemError);
- return NULL;
+ rc = doPwUmount(mntpoint, &err);
+ if (rc == IMOUNT_ERR_ERRNO) {
+ PyErr_SetFromErrno(PyExc_SystemError);
+ } else if (rc) {
+ PyObject *tuple = PyTuple_New(2);
+
+ PyTuple_SetItem(tuple, 0, PyInt_FromLong(rc));
+
+ if (err == NULL) {
+ Py_INCREF(Py_None);
+ PyTuple_SetItem(tuple, 1, Py_None);
+ } else {
+ PyTuple_SetItem(tuple, 1, PyString_FromString(err));
+ }
+
+ PyErr_SetObject(PyExc_SystemError, tuple);
+ }
+
+ if (rc) {
+ return NULL;
}
Py_INCREF(Py_None);