summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-device
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-06-01 23:53:37 +0200
committerTom Gundersen <teg@jklm.no>2015-06-02 18:12:47 +0200
commit7283a80d10217b929acf58899f016ca06dacdc53 (patch)
tree52164629813c64ba565357f7f37f2fd66f79c3ba /src/libsystemd/sd-device
parent4189708ad0cde8e211e38d27de943579772f8869 (diff)
sd-device: get_driver - remember if a device does not have a driver
Don't try to read it again.
Diffstat (limited to 'src/libsystemd/sd-device')
-rw-r--r--src/libsystemd/sd-device/sd-device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index af8137b1ae..ddb7b93ae7 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -901,8 +901,11 @@ _public_ int sd_device_get_driver(sd_device *device, const char **ret) {
if (r >= 0) {
r = device_set_driver(device, driver);
if (r < 0)
- return r;
- }
+ return log_debug_errno(r, "sd-device: could not set driver for %s: %m", device->devpath);
+ } else if (r == -ENOENT)
+ device->driver_set = true;
+ else
+ return log_debug_errno(r, "sd-device: could not set driver for %s: %m", device->devpath);
}
*ret = device->driver;