/* select the device that seems to match */
list_for_each_entry(device, &name_list, node) {
/* select the device that seems to match */
list_for_each_entry(device, &name_list, node) {
- udev_device_init(udev);
- if (udev_db_get_device(udev, device->name) != 0)
- continue;
+ udev_loop = udev_device_init();
+ if (udev_loop == NULL)
+ break;
+ if (udev_db_get_device(udev_loop, device->name) != 0)
+ goto next;
strlcpy(filename, udev_root, sizeof(filename));
strlcat(filename, "/", sizeof(filename));
strlcat(filename, name, sizeof(filename));
if (stat(filename, &statbuf) != 0)
strlcpy(filename, udev_root, sizeof(filename));
strlcat(filename, "/", sizeof(filename));
strlcat(filename, name, sizeof(filename));
if (stat(filename, &statbuf) != 0)
- continue;
- if (major(udev->devt) > 0 && udev->devt != statbuf.st_rdev) {
- info("skip '%s', dev_t doesn't match\n", udev->name);
- continue;
+ goto next;
+ if (major(udev_loop->devt) > 0 && udev_loop->devt != statbuf.st_rdev) {
+ info("skip '%s', dev_t doesn't match\n", udev_loop->name);
+ goto next;
while (1) {
option = getopt_long(argc, argv, "aed:n:p:q:rxPVh", options, NULL);
if (option == -1)
while (1) {
option = getopt_long(argc, argv, "aed:n:p:q:rxPVh", options, NULL);
if (option == -1)
if (udev_db_get_device(udev, path) != 0) {
fprintf(stderr, "no record for '%s' in database\n", path);
rc = 3;
goto exit;
}
} else if (name[0] != '\0') {
if (udev_db_get_device(udev, path) != 0) {
fprintf(stderr, "no record for '%s' in database\n", path);
rc = 3;
goto exit;
}
} else if (name[0] != '\0') {