get_media_device: Continue with the next dir entry on a sysfs parse error
authorHans de Goede <hdegoede@redhat.com>
Sat, 18 Jun 2011 13:13:40 +0000 (15:13 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 18 Jun 2011 13:31:37 +0000 (15:31 +0200)
Rather then completely aborting the sysfs-scanning.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
utils/libmedia_dev/get_media_devices.c

index 492a317..403f394 100644 (file)
@@ -125,7 +125,7 @@ static int get_class(char *class,
                        /* Remove the subsystem/class_name from the string */
                        p = strstr(device, class);
                        if (!p)
-                               goto error;
+                               continue;
                        *(p - 1) = '\0';
 
                        /* Remove USB sub-devices from the path */
@@ -133,7 +133,7 @@ static int get_class(char *class,
                                do {
                                        p = strrchr(device, '/');
                                        if (!p)
-                                               goto error;
+                                               continue;
                                        if (!strpbrk(p, ":."))
                                                break;
                                        *p = '\0';