diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-08-27 02:59:20 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-08-27 02:59:20 +0200 |
commit | db481105c2cf2092e1499736d6619bf194f91711 (patch) | |
tree | e83767636bda206ea85e31b26b1c2432910afca9 /udevinfo.c | |
parent | 3ad7a5b1a562ba71bea91ae3fba48e5b5947e285 (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.c | 21 |
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': |