chiark / gitweb /
udevd: fix REMOVE handling
[elogind.git] / src / libelogind / sd-device / sd-device.c
index 7a7b323f3ce61ab4d57668cb454f55a724f504a7..fd4622987c04f91c15401156b0eadb55e95ab854 100644 (file)
@@ -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;