]> err.no Git - util-linux/commitdiff
umount: add HAVE_LIBMOUNT_MOUNT code
authorKarel Zak <kzak@redhat.com>
Wed, 22 Dec 2010 12:12:57 +0000 (13:12 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 3 Jan 2011 11:28:48 +0000 (12:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/umount.c

index e762653817fda1b3742457f6584785397e96038e..7e4eff77a632a7ac98ff4711725337c3282d6b85 100644 (file)
@@ -335,7 +335,19 @@ umount_one (const char *spec, const char *node, const char *type,
  writemtab:
        if (!nomtab &&
            (umnt_err == 0 || umnt_err == EINVAL || umnt_err == ENOENT)) {
+#ifdef HAVE_LIBMOUNT_MOUNT
+               mnt_update *upd = mnt_new_update();
+
+               if (upd && !mnt_update_set_fs(upd, 0, node, NULL)) {
+                       mnt_lock *lc = init_libmount_lock(
+                                               mnt_update_get_filename(upd));
+                       mnt_update_tab(upd, lc);
+                       init_libmount_lock(NULL);
+               }
+               mnt_free_update(upd);
+#else
                update_mtab (node, NULL);
+#endif
        }
 
        if (res >= 0)