summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-04-22 18:50:43 +0200
committerKay Sievers <kay.sievers@vrfy.org>2010-04-22 18:50:43 +0200
commitbfd88b1d7b689ce86a2b04f62ac5a2b23b0aef84 (patch)
treead6e03a29fd3e7048758ca28fc33f71d1df5ab1c /libudev
parentf24362441f6165544888d8d97d63ff881e78f13f (diff)
fix logic on-demand loading logic for db and uevent
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c
index 478fdcb92d..3f441d0999 100644
--- a/libudev/libudev-device.c
+++ b/libudev/libudev-device.c
@@ -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;
}