diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-10-30 13:44:46 +0200 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 22:09:26 -0700 |
commit | e5e2ea95a4b21ebc5297881e7e8c5ab4425bac5e (patch) | |
tree | 1b1ceb5e5738286f22ae7cca7642df699037b6a3 /udevtest.c | |
parent | a9ce6041228c12aad06666904af8dbe3acfd3115 (diff) |
[PATCH] Exit, if udevtest cannot open the device (segfault).
Diffstat (limited to 'udevtest.c')
-rw-r--r-- | udevtest.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/udevtest.c b/udevtest.c index f2b0c98edb..8af2120fb1 100644 --- a/udevtest.c +++ b/udevtest.c @@ -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; |