if (r == -EACCES)
/* empty uevent files may be write-only */
return 0;
+ else if (r == -ENOENT)
+ /* some devices may not have uevent files, see set_syspath() */
+ return 0;
else if (r < 0) {
log_debug("sd-device: failed to read uevent file '%s': %s", path, strerror(-r));
return r;
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;
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);
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;