chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a9ce604
)
[PATCH] Exit, if udevtest cannot open the device (segfault).
author
kay.sievers@vrfy.org
<kay.sievers@vrfy.org>
Sat, 30 Oct 2004 11:44:46 +0000
(13:44 +0200)
committer
Greg KH
<gregkh@suse.de>
Wed, 27 Apr 2005 05:09:26 +0000
(22:09 -0700)
udevtest.c
patch
|
blob
|
history
diff --git
a/udevtest.c
b/udevtest.c
index f2b0c98edb2dd35a720c2960bbdd775c1a468098..8af2120fb16856485036eb467e634b4d927ceedb 100644
(file)
--- 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);
/* 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;
/* simulate node creation with test flag */
udev.test_run = 1;