diff options
author | Tom Gundersen <teg@jklm.no> | 2015-04-01 13:55:52 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-04-12 11:29:00 -0400 |
commit | c48e712fee1ed30b15d494ea42e1b6faffaade05 (patch) | |
tree | 0ea4d81168d089bf2e6b1999acabacf6a38cda23 /src/libudev | |
parent | b97ee4d9441856aed4de1267321ff4edab4ffe5b (diff) |
libudev: monitor - improve logging
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-monitor.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index 07b23e9b35..26c265dc93 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -647,6 +647,8 @@ retry: return NULL; } if (buf.nlh.properties_off+32 > (size_t)buflen) { + log_debug("message smaller than expected (%u > %zd)", + buf.nlh.properties_off+32, buflen); return NULL; } @@ -670,8 +672,10 @@ retry: } udev_device = udev_device_new_from_nulstr(udev_monitor->udev, &buf.raw[bufpos], buflen - bufpos); - if (!udev_device) + if (!udev_device) { + log_debug("could not create device: %m"); return NULL; + } if (is_initialized) udev_device_set_is_initialized(udev_device); @@ -716,8 +720,10 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, uint64_t tag_bloom_bits; blen = udev_device_get_properties_monitor_buf(udev_device, &buf); - if (blen < 32) + if (blen < 32) { + log_debug("device buffer is too small to contain a valid device"); return -EINVAL; + } /* fill in versioned header */ val = udev_device_get_subsystem(udev_device); |