200c7854a4
This (and the related 20 to 30 updates) has been tested twice in a bulk by landry@, thanks! Runtime testing by myself under heavy GNOME usage...
35 lines
963 B
Plaintext
35 lines
963 B
Plaintext
$OpenBSD: patch-gio_gunixmount_c,v 1.3 2011/03/07 19:17:14 ajacoutot Exp $
|
|
|
|
Removable device needs to be unmounted before it is ejected.
|
|
|
|
--- gio/gunixmount.c.orig Sun Nov 14 20:34:22 2010
|
|
+++ gio/gunixmount.c Mon Jan 31 10:14:44 2011
|
|
@@ -29,6 +29,11 @@
|
|
#include <sys/wait.h>
|
|
#include <unistd.h>
|
|
|
|
+#ifdef __OpenBSD__
|
|
+#include <sys/param.h>
|
|
+#include <sys/mount.h>
|
|
+#endif
|
|
+
|
|
#include <glib.h>
|
|
#include "gunixvolumemonitor.h"
|
|
#include "gunixmount.h"
|
|
@@ -451,10 +456,15 @@ g_unix_mount_eject (GMount *mount,
|
|
GUnixMount *unix_mount = G_UNIX_MOUNT (mount);
|
|
char *argv[] = {"eject", NULL, NULL};
|
|
|
|
+#ifdef __OpenBSD__
|
|
+ if (unmount(unix_mount->mount_path, MNT_FORCE) == 0)
|
|
+ argv[1] = unix_mount->device_path;
|
|
+#else
|
|
if (unix_mount->mount_path != NULL)
|
|
argv[1] = unix_mount->mount_path;
|
|
else
|
|
argv[1] = unix_mount->device_path;
|
|
+#endif // __OpenBSD__
|
|
|
|
eject_unmount_do (mount, cancellable, callback, user_data, argv);
|
|
}
|