1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

[PATCH] Exit, if udevtest cannot open the device (segfault).

This commit is contained in:
kay.sievers@vrfy.org 2004-10-30 13:44:46 +02:00 committed by Greg KH
parent a9ce604122
commit e5e2ea95a4

View File

@ -108,10 +108,12 @@ int main(int argc, char *argv[], char *envp[])
/* open the device */
snprintf(path, SYSFS_PATH_MAX, "%s%s", sysfs_path, udev.devpath);
class_dev = sysfs_open_class_device_path(path);
if (class_dev == NULL)
dbg ("sysfs_open_class_device_path failed");
else
dbg("opened class_dev->name='%s'", class_dev->name);
if (class_dev == NULL) {
info("sysfs_open_class_device_path failed");
return 1;
}
dbg("opened class_dev->name='%s'", class_dev->name);
/* simulate node creation with test flag */
udev.test_run = 1;