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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
commit 7ca14a9265548dc74cc6b16517d8d3f23e6d4c6c
Author: Sjoerd Simons <sjoerd@luon.net>
Date: Mon Oct 2 18:26:18 2006 +0200
use dbus_error_free instead of LIBHAL_FREE_DBUS_ERROR so errors are correctly
reported to hald-runner
Various tools use LIBHAL_FREE_DBUS_ERROR, which will print an error to stderror
when the error is not set. Because the runner uses stderror to get the errors
from the callout, this confuses it somewhat. Using dbus_error_free instead of
LIBHAL_FREE_DBUS_ERROR solves this.
diff --git a/tools/hal-storage-closetray.c b/tools/hal-storage-closetray.c
index 755ccd1..2866afd 100644
--- a/tools/hal-storage-closetray.c
+++ b/tools/hal-storage-closetray.c
@@ -107,7 +107,7 @@ #endif
dbus_error_init (&error);
if ((hal_ctx = libhal_ctx_init_direct (&error)) == NULL) {
printf ("Cannot connect to hald\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
@@ -115,7 +115,7 @@ #endif
system_bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
if (system_bus == NULL) {
printf ("Cannot connect to the system bus\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
#ifdef HAVE_POLKIT
diff --git a/tools/hal-storage-eject.c b/tools/hal-storage-eject.c
index 65248f3..3234be4 100644
--- a/tools/hal-storage-eject.c
+++ b/tools/hal-storage-eject.c
@@ -109,7 +109,7 @@ #endif
dbus_error_init (&error);
if ((hal_ctx = libhal_ctx_init_direct (&error)) == NULL) {
printf ("Cannot connect to hald\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
@@ -117,7 +117,7 @@ #endif
system_bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
if (system_bus == NULL) {
printf ("Cannot connect to the system bus\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
#ifdef HAVE_POLKIT
diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
index ef8d1a9..9c1348d 100644
--- a/tools/hal-storage-mount.c
+++ b/tools/hal-storage-mount.c
@@ -272,7 +272,7 @@ volume_findby (LibHalContext *hal_ctx, c
dbus_error_init (&error);
if ((hal_udis = libhal_manager_find_device_string_match (hal_ctx, property,
value, &num_hal_udis, &error)) == NULL) {
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
goto out;
}
for (i = 0; i < num_hal_udis; i++) {
@@ -493,7 +493,7 @@ #endif
dbus_error_init (&error);
if (libhal_device_get_property_bool (hal_ctx, udi, "volume.ignore", &error) ||
dbus_error_is_set (&error)) {
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
permission_denied_volume_ignore (device);
}
@@ -1011,7 +1011,7 @@ #endif
dbus_error_init (&error);
if ((hal_ctx = libhal_ctx_init_direct (&error)) == NULL) {
printf ("Cannot connect to hald\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
@@ -1019,7 +1019,7 @@ #endif
system_bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
if (system_bus == NULL) {
printf ("Cannot connect to the system bus\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
#ifdef HAVE_POLKIT
diff --git a/tools/hal-storage-shared.c b/tools/hal-storage-shared.c
index 0b95a35..f6e0bf2 100644
--- a/tools/hal-storage-shared.c
+++ b/tools/hal-storage-shared.c
@@ -288,7 +288,7 @@ #endif
dbus_error_init (&error);
if (libhal_device_get_property_bool (hal_ctx, udi, "volume.ignore", &error) ||
dbus_error_is_set (&error)) {
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
permission_denied_volume_ignore (device);
}
diff --git a/tools/hal-storage-unmount.c b/tools/hal-storage-unmount.c
index d1239f7..ef7cee9 100644
--- a/tools/hal-storage-unmount.c
+++ b/tools/hal-storage-unmount.c
@@ -112,7 +112,7 @@ #endif
dbus_error_init (&error);
if ((hal_ctx = libhal_ctx_init_direct (&error)) == NULL) {
printf ("Cannot connect to hald\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
@@ -120,7 +120,7 @@ #endif
system_bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
if (system_bus == NULL) {
printf ("Cannot connect to the system bus\n");
- LIBHAL_FREE_DBUS_ERROR (&error);
+ dbus_error_free (&error);
usage ();
}
#ifdef HAVE_POLKIT
|