summaryrefslogtreecommitdiff
path: root/udevinfo.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-27 02:59:20 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-27 02:59:20 +0200
commitdb481105c2cf2092e1499736d6619bf194f91711 (patch)
treee83767636bda206ea85e31b26b1c2432910afca9 /udevinfo.c
parent3ad7a5b1a562ba71bea91ae3fba48e5b5947e285 (diff)
prepare for new HAL udevdb dump
HAL soon wants to read the whole content of the udevdatabase while starting up. This makes the whole udev structure available to the udevinfo "dump". Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udevinfo.c')
-rw-r--r--udevinfo.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/udevinfo.c b/udevinfo.c
index 58584d62f8..814bd1e90a 100644
--- a/udevinfo.c
+++ b/udevinfo.c
@@ -165,9 +165,22 @@ exit:
return retval;
}
-static int print_dump(const char *devpath, const char *name) {
- printf("%s=%s/%s\n", devpath, udev_root, name);
- return 0;
+static void dump_names(void) {
+ LIST_HEAD(name_list);
+ struct name_entry *name_loop;
+ struct name_entry *tmp_loop;
+
+ udev_db_get_all_entries(&name_list);
+ list_for_each_entry_safe(name_loop, tmp_loop, &name_list, node) {
+ struct udevice udev_db;
+
+ udev_init_device(&udev_db, NULL, NULL, NULL);
+ if (udev_db_get_device(&udev_db, name_loop->name) == 0) {
+ printf("%s=%s/%s\n", udev_db.devpath, udev_root, udev_db.name);
+ free(name_loop);
+ }
+ udev_cleanup_device(&udev_db);
+ }
}
int main(int argc, char *argv[], char *envp[])
@@ -256,7 +269,7 @@ int main(int argc, char *argv[], char *envp[])
break;
case 'd':
- udev_db_dump_names(print_dump);
+ dump_names();
goto exit;
case 'V':