From bba061662b0f759abb43bad60c9733305c191045 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 14 Apr 2015 15:15:49 +0200 Subject: sd-device: allow uevent files to be write-only --- src/libsystemd/sd-device/sd-device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libsystemd') diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index b828fa830a..7d52e3cc1d 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -499,7 +499,10 @@ int device_read_uevent_file(sd_device *device) { path = strjoina(syspath, "/uevent"); r = read_full_file(path, &uevent, &uevent_len); - if (r < 0) { + if (r == -EACCES) + /* empty uevent files may be write-only */ + return 0; + else if (r < 0) { log_debug("sd-device: failed to read uevent file '%s': %s", path, strerror(-r)); return r; } -- cgit v1.2.3-54-g00ecf