summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-device/sd-device.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-04-23 15:19:13 +0200
committerTom Gundersen <teg@jklm.no>2015-04-23 22:31:25 +0200
commit107f2e2526d476c6cc9b81a690391c111027d641 (patch)
tree7c6b71cc8e761b1083fb0ed42ba68f26a2fe15e5 /src/libsystemd/sd-device/sd-device.c
parent353f605867f9dac1eea4ad8ebaa92a004cbcd9e7 (diff)
udevd: fix REMOVE handling
This reverts b67f944. Lazy loading of device properties does not work for devices that are received over netlink, as these are sealed. Reinstate the unconditional loading of the device db. Reported by: Mantas Mikulėnas <grawity@gmail.com>.
Diffstat (limited to 'src/libsystemd/sd-device/sd-device.c')
-rw-r--r--src/libsystemd/sd-device/sd-device.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index 7a7b323f3c..fd4622987c 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -1220,7 +1220,7 @@ int device_get_id_filename(sd_device *device, const char **ret) {
return 0;
}
-static int device_read_db(sd_device *device) {
+int device_read_db_aux(sd_device *device, bool force) {
_cleanup_free_ char *db = NULL;
char *path;
const char *id, *value;
@@ -1237,7 +1237,7 @@ static int device_read_db(sd_device *device) {
INVALID_LINE,
} state = PRE_KEY;
- if (device->db_loaded || device->sealed)
+ if (device->db_loaded || (!force && device->sealed))
return 0;
r = device_get_id_filename(device, &id);
@@ -1313,6 +1313,10 @@ static int device_read_db(sd_device *device) {
return 0;
}
+static int device_read_db(sd_device *device) {
+ return device_read_db_aux(device, false);
+}
+
_public_ int sd_device_get_is_initialized(sd_device *device, int *initialized) {
int r;