When permissions are set up accordingly and kern.usermount is set to 1,
make it possible to umount and eject CDs using gio.
This commit is contained in:
parent
84c63f751b
commit
d8bef1a1a9
@ -1,11 +1,11 @@
|
||||
# $OpenBSD: Makefile,v 1.80 2010/04/22 19:34:06 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.81 2010/04/29 16:38:41 ajacoutot Exp $
|
||||
|
||||
COMMENT-main= general-purpose utility library
|
||||
COMMENT-docs= glib2 documentation
|
||||
|
||||
VERSION= 2.24.0
|
||||
DISTNAME= glib-${VERSION}
|
||||
PKGNAME-main= glib2-${VERSION}
|
||||
PKGNAME-main= glib2-${VERSION}p0
|
||||
PKGNAME-docs= glib2-docs-${VERSION}
|
||||
|
||||
CATEGORIES= devel
|
||||
|
34
devel/glib2/patches/patch-gio_gunixmount_c
Normal file
34
devel/glib2/patches/patch-gio_gunixmount_c
Normal file
@ -0,0 +1,34 @@
|
||||
$OpenBSD: patch-gio_gunixmount_c,v 1.1 2010/04/29 16:38:41 ajacoutot Exp $
|
||||
|
||||
Removable device needs to be unmounted before it is ejected.
|
||||
|
||||
--- gio/gunixmount.c.orig Sat Aug 29 04:52:23 2009
|
||||
+++ gio/gunixmount.c Thu Apr 29 14:13:50 2010
|
||||
@@ -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"
|
||||
@@ -453,10 +458,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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user