patches/gnome-mount-01-sun-patch.diff
author Jon Tibble <meths@btinternet.com>
Sat, 06 Oct 2012 16:11:50 +0100
branchs11express-2010-11
changeset 22109 db10202d5f6d
parent 16580 575099ec883c
permissions -rw-r--r--
Added tag oi_151a_prestable7 for changeset 25dee50cecca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16580
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
     1
--- gnome-mount-0.4/src/gnome-mount.c-orig	2009-09-17 10:30:23.371242221 -0500
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
     2
+++ gnome-mount-0.4/src/gnome-mount.c	2009-09-17 10:30:28.283317232 -0500
7490
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     3
@@ -42,7 +42,11 @@
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     4
 #include <libhal.h>
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     5
 #include <libhal-storage.h>
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     6
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     7
+#ifndef sun
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     8
 #include <mntent.h>
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     9
+#else
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    10
+#include <sys/mnttab.h>
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    11
+#endif
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    12
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    13
 static DBusConnection *dbus_connection;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    14
 static LibHalContext *hal_ctx;
16580
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    15
@@ -54,6 +58,8 @@ static gboolean opt_noui = FALSE;
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    16
 static gboolean opt_block = FALSE;
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    17
 static gboolean opt_nodisplay = FALSE;
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    18
 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    19
+#define DBUS_TIMEOUT G_MAXINT
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    20
+
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    21
 static void 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    22
 notify_parent (gboolean success)
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    23
 {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    24
@@ -396,6 +402,51 @@ get_dev_file (LibHalVolume *volume, LibH
7490
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    25
 		return NULL;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    26
 }
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    27
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    28
+static char *
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    29
+get_mntent_mount_point(const char *device_file)
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    30
+{
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    31
+	char *mount_point;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    32
+	FILE *f;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    33
+#ifndef sun
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    34
+	struct mntent mnt;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    35
+	struct mntent *mnte;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    36
+	char buf[512];
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    37
+#else
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    38
+	struct mnttab mnt;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    39
+	struct mnttab mpref = { NULL, NULL, NULL, NULL, NULL };
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    40
+#endif
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    41
+
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    42
+	mount_point = NULL;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    43
+
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    44
+#ifndef sun
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    45
+	if ((f = setmntent ("/proc/mounts", "r")) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    46
+		
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    47
+		while ((mnte = getmntent_r (f, &mnt, buf, sizeof(buf))) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    48
+			if (strcmp (mnt.mnt_fsname, device_file) == 0) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    49
+				if (mnt.mnt_dir != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    50
+					mount_point = g_strdup (mnt.mnt_dir);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    51
+				}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    52
+				break;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    53
+			}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    54
+		}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    55
+		endmntent (f);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    56
+	}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    57
+
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    58
+#else /* sun */
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    59
+
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    60
+	if ((f = fopen(MNTTAB, "r")) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    61
+		mpref.mnt_special = (char *)device_file;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    62
+		if (getmntany(f, &mnt, &mpref) == 0) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    63
+			mount_point = g_strdup (mnt.mnt_mountp);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    64
+		}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    65
+		fclose(f);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    66
+	}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    67
+
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    68
+#endif /* sun */
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    69
+
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    70
+out:
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    71
+	return (mount_point);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    72
+}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    73
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    74
 static gboolean
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    75
 volume_mount_with_options (const char *udi, LibHalVolume *volume, LibHalDrive *drive,
16580
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    76
@@ -406,6 +457,8 @@ volume_mount_with_options (const char *u
7490
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    77
 	gboolean ret = FALSE;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    78
 	DBusError error;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    79
 	unsigned int i;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    80
+	const char *device_file;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    81
+	char *mounted_at;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    82
 	
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    83
 	if (mount_point == NULL)
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    84
 		mount_point = "";
16580
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    85
@@ -437,7 +490,7 @@ volume_mount_with_options (const char *u
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    86
 	}
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    87
 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    88
 	dbus_error_init (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    89
-	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, dmesg, -1, &error)) ||
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    90
+	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, dmesg, DBUS_TIMEOUT, &error)) ||
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    91
 	    dbus_error_is_set (&error)) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    92
 		g_warning ("Mount failed for %s\n%s : %s\n", udi, error.name, error.message);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    93
 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
    94
@@ -471,35 +524,11 @@ volume_mount_with_options (const char *u
7490
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    95
 		goto out;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    96
 	}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    97
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    98
-	{
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    99
-		char *mount_point;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   100
-		const char *device_file;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   101
-
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   102
-		mount_point = NULL;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   103
-		device_file = get_dev_file (volume, drive);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   104
-
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   105
-		if (device_file != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   106
-			FILE *f;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   107
-			struct mntent mnt;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   108
-			struct mntent *mnte;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   109
-			char buf[512];
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   110
-
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   111
-			if ((f = setmntent ("/proc/mounts", "r")) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   112
-				
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   113
-				while ((mnte = getmntent_r (f, &mnt, buf, sizeof(buf))) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   114
-					if (strcmp (mnt.mnt_fsname, device_file) == 0) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   115
-						if (mnt.mnt_dir != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   116
-							mount_point = g_strdup (mnt.mnt_dir);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   117
-						}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   118
-						break;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   119
-					}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   120
-				}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   121
-				endmntent (f);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   122
-			}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   123
+	if ((device_file = get_dev_file (volume, drive)) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   124
+		if ((mounted_at = get_mntent_mount_point(device_file)) != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   125
+			g_print (_("Mounted %s at \"%s\"\n"), device_file, mounted_at);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   126
+			g_free (mounted_at);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   127
 		}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   128
-
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   129
-		g_print (_("Mounted %s at \"%s\"\n"), device_file, mount_point);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   130
-		g_free (mount_point);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   131
 	}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   132
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   133
 	ret = TRUE;
16580
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   134
@@ -722,7 +751,7 @@ volume_unmount (const char *udi, LibHalV
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   135
 	}
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   136
 		
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   137
 	dbus_error_init (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   138
-	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, -1, &error)) ||
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   139
+	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, DBUS_TIMEOUT, &error)) ||
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   140
 	    dbus_error_is_set (&error)) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   141
 		g_warning ("Unmount failed for %s: %s : %s\n", udi, error.name, error.message);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   142
 		show_error_dialog_unmount (udi, volume, drive, error.name, error.message);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   143
@@ -771,7 +800,7 @@ volume_eject (const char *udi, LibHalVol
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   144
 	}
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   145
 	
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   146
 	dbus_error_init (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   147
-	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, -1, &error))) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   148
+	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, DBUS_TIMEOUT, &error))) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   149
 		g_warning ("Eject failed for %s: %s : %s\n", udi, error.name, error.message);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   150
 		dbus_error_free (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   151
 		goto out;
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   152
@@ -1092,7 +1121,7 @@ setup_crypto (const char *udi, LibHalVol
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   153
 	}
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   154
 	
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   155
 	dbus_error_init (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   156
-	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, -1, &error)) || 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   157
+	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, DBUS_TIMEOUT, &error)) || 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   158
 	    dbus_error_is_set (&error)) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   159
 		g_warning ("Setup failed for %s: %s : %s\n", udi, error.name, error.message);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   160
 		if (strcmp (error.name, "org.freedesktop.Hal.Device.Volume.Crypto.SetupPasswordError") == 0) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   161
@@ -1164,7 +1193,7 @@ teardown_crypto (const char *udi, LibHal
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   162
 	}
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   163
 	
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   164
 	dbus_error_init (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   165
-	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, -1, &error)) || 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   166
+	if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, msg, DBUS_TIMEOUT, &error)) || 
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   167
 	    dbus_error_is_set (&error)) {
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   168
 		g_warning ("Teardown failed for %s: %s : %s\n", udi, error.name, error.message);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   169
 		dbus_error_free (&error);
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   170
@@ -1480,6 +1509,7 @@ main (int argc, char *argv[])
7490
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   171
 		goto out;
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   172
 
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   173
 	if (opt_device_file != NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   174
+#ifndef sun
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   175
 		resolved_device_file = resolve_symlink (opt_device_file);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   176
 		if (resolved_device_file == NULL) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   177
 			goto out;
16580
575099ec883c 2009-09-17 Brian Cameron <[email protected]>
yippi
parents: 15540
diff changeset
   178
@@ -1487,6 +1517,9 @@ main (int argc, char *argv[])
7490
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   179
 		if (strcmp (resolved_device_file, opt_device_file) != 0) {
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   180
 			g_print (_("Resolved device file %s -> %s\n"), opt_device_file, resolved_device_file);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   181
 		}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   182
+#else /* sun */
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   183
+		resolved_device_file = g_strdup (opt_device_file);
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   184
+#endif /* sun */
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   185
 	}
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   186
 		
b878e3848818 2006-06-21 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
   187
 	if (opt_hal_udi != NULL) {