summaryrefslogtreecommitdiff
path: root/tools/hal-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/hal-device.c')
-rw-r--r--tools/hal-device.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/hal-device.c b/tools/hal-device.c
index e8bf3480..38458a5f 100644
--- a/tools/hal-device.c
+++ b/tools/hal-device.c
@@ -189,6 +189,7 @@ int dump_devices(LibHalContext *hal_ctx, char *arg)
{
int i;
int num_devices;
+ int retval;
char **device_names;
DBusError error;
char *udi = NULL;
@@ -222,6 +223,9 @@ int dump_devices(LibHalContext *hal_ctx, char *arg)
num_devices = 1;
}
+ /* if _any_ device matches, we return success */
+ retval = 1;
+
for(i = 0; i < num_devices; i++) {
LibHalPropertySet *props;
LibHalPropertySetIterator it;
@@ -233,6 +237,9 @@ int dump_devices(LibHalContext *hal_ctx, char *arg)
continue;
}
+ /* we got some properties */
+ retval = 0;
+
if (!udi)
printf("%d: ", i);
printf("udi = '%s'\n", device_names[i]);
@@ -298,7 +305,7 @@ int dump_devices(LibHalContext *hal_ctx, char *arg)
libhal_free_string_array(device_names);
dbus_error_free(&error);
- return 0;
+ return retval;
}