1
diff -ruN gnome-volume-manager-1.5.15-old/src/manager.c gnome-volume-manager-1.5.15/src/manager.c
2
--- gnome-volume-manager-1.5.15-old/src/manager.c 2006-04-27 16:14:23.000000000 +0200
3
+++ gnome-volume-manager-1.5.15/src/manager.c 2006-04-27 16:16:10.000000000 +0200
6
dbg ("mounting %s...\n", udi);
8
- if (!gnome_mount || access (gnome_mount, F_OK | R_OK | X_OK) != 0) {
9
- g_free (gnome_mount);
10
- gnome_mount = g_find_program_in_path ("gnome-mount");
12
+ gnome_mount = g_find_program_in_path ("pmount-hal");
14
if (gnome_mount != NULL) {
16
@@ -1732,16 +1729,14 @@
18
g_hash_table_insert (mount_table, policy->udi, policy);
21
- command = g_strdup_printf ("%s --no-ui --hal-udi=%%h", gnome_mount);
23
- command = g_strdup_printf ("%s --hal-udi=%%h", gnome_mount);
26
- retval = gvm_run_command (command, udi, NULL, NULL);
30
+ char* argv[] = { gnome_mount, udi, NULL };
33
+ if (!g_spawn_sync (NULL, argv, NULL, 0, NULL, NULL, NULL, NULL,
34
+ &exit_status, NULL) ||
35
+ !WIFEXITED(exit_status) || WEXITSTATUS (exit_status)) {
36
+ dbg ("executing %s %s failed with status %i\n",
37
+ gnome_mount, udi, exit_status);
38
g_hash_table_remove (mount_table, policy->udi);
41
@@ -1878,14 +1873,21 @@
43
dbg ("unmounting %s...\n", udi);
45
- if (!gnome_mount || access (gnome_mount, F_OK | R_OK | X_OK) != 0) {
46
- g_free (gnome_mount);
47
- gnome_mount = g_find_program_in_path ("gnome-mount");
49
+ gnome_mount = g_find_program_in_path ("pumount");
51
if (gnome_mount != NULL) {
52
- command = g_strdup_printf ("%s --unmount --hal-udi=%%h", gnome_mount);
53
- retval = gvm_run_command (command, udi, NULL, NULL);
54
+ command = g_strdup_printf ("%s %%d", gnome_mount);
56
+ const char* device = NULL;
57
+ dbus_error_init (&error);
58
+ if (!(device = libhal_device_get_property_string (hal_ctx, udi, "block.device", &error))) {
59
+ warn ("cannot get block.device: %s\n", error.message);
60
+ if (dbus_error_is_set (&error))
61
+ dbus_error_free (&error);
65
+ retval = gvm_run_command (command, udi, device, NULL);
69
@@ -2597,14 +2599,21 @@
71
dbg ("ejecting %s...\n", volume);
73
- if (!gnome_mount || access (gnome_mount, F_OK | R_OK | X_OK) != 0) {
74
- g_free (gnome_mount);
75
- gnome_mount = g_find_program_in_path ("gnome-mount");
77
+ gnome_mount = g_find_program_in_path ("eject");
79
if (gnome_mount != NULL) {
80
- command = g_strdup_printf ("%s --eject --hal-udi=%%h", gnome_mount);
81
- gvm_run_command (command, volume, NULL, NULL);
82
+ command = g_strdup_printf ("%s %%d", gnome_mount);
84
+ const char* device = NULL;
85
+ dbus_error_init (&error);
86
+ if (!(device = libhal_device_get_property_string (hal_ctx, udi, "block.device", &error))) {
87
+ warn ("cannot get block.device: %s\n", error.message);
88
+ if (dbus_error_is_set (&error))
89
+ dbus_error_free (&error);
93
+ gvm_run_command (command, volume, device, NULL);
96
if (!(dmesg = dbus_message_new_method_call ("org.freedesktop.Hal", volume,