X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=wait_for_sysfs.c;h=91a2b6b62884c3a446dd2936aa6bbce9bd922c4f;hb=56b979e00d87d1766b61716f07870701aca20ead;hp=e7eed441eee628bfac670aae6988fbfd9282a54e;hpb=f071348004c8069b610effd95309ff47c515cf3e;p=elogind.git diff --git a/wait_for_sysfs.c b/wait_for_sysfs.c index e7eed441e..91a2b6b62 100644 --- a/wait_for_sysfs.c +++ b/wait_for_sysfs.c @@ -99,6 +99,12 @@ int main(int argc, char *argv[], char *envp[]) snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath); filename[SYSFS_PATH_MAX-1] = '\0'; + /* skip bad events where we get no device for the class */ + if (strncmp(devpath, "/class/", 7) == 0 && strchr(&devpath[7], '/') == NULL) { + dbg("no device name for '%s', bad event", devpath); + goto exit; + } + /* open the class device we are called for */ class_dev = open_class_device_wait(filename); if (!class_dev) {