]> err.no Git - systemd/commitdiff
fix logic on-demand loading logic for db and uevent
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 22 Apr 2010 16:50:43 +0000 (18:50 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 22 Apr 2010 16:50:43 +0000 (18:50 +0200)
libudev/libudev-device.c

index 478fdcb92d7f80231662b10ccfceef6f1a2c7900..3f441d099921da31a76382fa4a3351ec6c2764ee 100644 (file)
@@ -284,6 +284,8 @@ int udev_device_read_db(struct udev_device *udev_device)
                dbg(udev_device->udev, "error reading db file %s: %m\n", filename);
                return -1;
        }
+       udev_device->db_loaded = true;
+
        while (fgets(line, sizeof(line), f)) {
                ssize_t len;
                const char *val;
@@ -322,7 +324,6 @@ int udev_device_read_db(struct udev_device *udev_device)
        fclose(f);
 
        info(udev_device->udev, "device %p filled with db file data\n", udev_device);
-       udev_device->db_loaded = true;
        return 0;
 }
 
@@ -341,6 +342,7 @@ int udev_device_read_uevent_file(struct udev_device *udev_device)
        f = fopen(filename, "r");
        if (f == NULL)
                return -1;
+       udev_device->uevent_loaded = true;
 
        while (fgets(line, sizeof(line), f)) {
                char *pos;
@@ -364,7 +366,6 @@ int udev_device_read_uevent_file(struct udev_device *udev_device)
 
        udev_device->devnum = makedev(maj, min);
        fclose(f);
-       udev_device->uevent_loaded = true;
        return 0;
 }