Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 4285738ee48957a402bc1469869044e9 > files > 3

tray-0.1-0.20081105.2mdv2009.0.src.rpm

diff -p -up tray/eject.c.pmount tray/eject.c
--- tray/eject.c.pmount	2008-11-04 18:11:00.000000000 +0100
+++ tray/eject.c	2008-11-14 16:28:02.000000000 +0100
@@ -9,6 +9,7 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
 #include <libhal.h>
+#include <unistd.h>
 
 #include "tray.h"
 
@@ -69,10 +70,14 @@ static int res = 0;
 static void eject_device(gpointer key, gpointer value, gpointer user_data)
 {
 	struct mdev *m = value;
-	char cmd[256];
+	char cmd[256], mountcmd[8];
 
 	if (value) {
-		snprintf(cmd, 256, "umount %s", m->mountpoint);
+		if (!access("/usr/bin/pumount", X_OK))
+			snprintf(mountcmd, 8, "%s", "pumount");
+		else
+			snprintf(mountcmd, 8, "%s", "umount");
+		snprintf(cmd, 256, "%s %s", mountcmd, m->mountpoint);
 		res |= system(cmd);
 	}
 }