[systemd-commits] 3 commits - src/libsystemd src/libudev
Tom Gundersen
tomegun at kemper.freedesktop.org
Sat Apr 25 16:32:28 PDT 2015
src/libsystemd/sd-device/sd-device.c | 11 +++++++----
src/libudev/libudev-monitor.c | 4 ++--
2 files changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 965288c5eed1c49057d0131ca85b7db18d340778
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Apr 26 01:09:34 2015 +0200
libudev: monitor - clarify log messages
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index e9d403c..60f11c1 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -759,13 +759,13 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor,
count = sendmsg(udev_monitor->sock, &smsg, 0);
if (count < 0) {
if (!destination && errno == ECONNREFUSED) {
- log_debug("passed unknown number of bytes to netlink monitor %p", udev_monitor);
+ log_debug("passed device to to netlink monitor %p", udev_monitor);
return 0;
} else
return -errno;
}
- log_debug("passed %zi bytes to netlink monitor %p", count, udev_monitor);
+ log_debug("passed %zi byte device to netlink monitor %p", count, udev_monitor);
return count;
}
commit 7141e4f62c3f220872df3114c42d9e4b9525e43e
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Apr 26 01:07:42 2015 +0200
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.
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index 9ef851a..691b9c6 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;
}
commit 2a2137401b3aef20618308d2b2694e21b0124f89
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Apr 26 01:04:33 2015 +0200
sd-device: don't complain if the uevent file is missing
Only 'real' devices are required to have an uevent file.
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index fd46229..9ef851a 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -510,6 +510,9 @@ int device_read_uevent_file(sd_device *device) {
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;
More information about the systemd-commits
mailing list