diff options
author | Tom Gundersen <teg@jklm.no> | 2015-04-26 01:07:42 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-04-26 01:30:23 +0200 |
commit | 7141e4f62c3f220872df3114c42d9e4b9525e43e (patch) | |
tree | e1f475aaaea22fd96dca29c4c85ff6104fdbc313 /src/libsystemd/sd-device | |
parent | 2a2137401b3aef20618308d2b2694e21b0124f89 (diff) |
sd-device: don't retry loading uevent/db files more than once
If for whatever reason there was nothing to load or loading failed, don't keep trying.
Diffstat (limited to 'src/libsystemd/sd-device')
-rw-r--r-- | src/libsystemd/sd-device/sd-device.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 9ef851a6bb..691b9c6327 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -500,6 +500,8 @@ int device_read_uevent_file(sd_device *device) { if (device->uevent_loaded || device->sealed) return 0; + device->uevent_loaded = true; + r = sd_device_get_syspath(device, &syspath); if (r < 0) return r; @@ -570,8 +572,6 @@ int device_read_uevent_file(sd_device *device) { log_debug("sd-device: could not set 'MAJOR=%s' or 'MINOR=%s' from '%s': %s", major, minor, path, strerror(-r)); } - device->uevent_loaded = true; - return 0; } @@ -1243,6 +1243,8 @@ int device_read_db_aux(sd_device *device, bool force) { if (device->db_loaded || (!force && device->sealed)) return 0; + device->db_loaded = true; + r = device_get_id_filename(device, &id); if (r < 0) return r; @@ -1311,8 +1313,6 @@ int device_read_db_aux(sd_device *device, bool force) { } } - device->db_loaded = true; - return 0; } |