summaryrefslogtreecommitdiff
blob: a508c81967491536f6f15d609c3a970efb8f4f5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Ripped from Fedora [merged upstream]

More recent kernels actually want to umount using the mount point and
not the device name (this makes more sense, you can have the same
device mounted in many places).

This is a minor changes to do just that.

--- eject-2.0.13deb/eject.c
+++ eject-2.0.13deb/eject.c
@@ -718,8 +718,8 @@
 			status = regexec(&preg, s1, 0, 0, 0);
 			if (status == 0) {
 				if (v_option)
-					printf(_("%s: unmounting `%s'\n"), programName, s1);
-				Unmount(s1);
+					printf(_("%s: unmounting `%s'\n"), programName, s2);
+				Unmount(s2);
 				regfree(&preg);
 			}
 		}
@@ -952,8 +952,8 @@
 	/* unmount device if mounted */
 	if (mounted) {
 		if (v_option)
-			printf(_("%s: unmounting `%s'\n"), programName, deviceName);
-		Unmount(deviceName);
+			printf(_("%s: unmounting device `%s' from `%s'\n"), programName, deviceName, mountName);
+		Unmount(mountName);
 	}
 
 	/* if it is a multipartition device, unmount any other partitions on