diff options
author | Kay Sievers <kay@vrfy.org> | 2014-11-13 11:42:24 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-11-13 11:42:24 +0100 |
commit | a974cacd9ac179599f3645409664ccb254ed6bbb (patch) | |
tree | 2387d69e70b0bb569779c5a535ad55ab51ae29ce | |
parent | 281e05b6cb406debe7b290e5aee8eae049671c14 (diff) |
libudev: we do not log errors from libraries
-rw-r--r-- | src/libudev/libudev-device-private.c | 4 | ||||
-rw-r--r-- | src/libudev/libudev-monitor.c | 10 | ||||
-rw-r--r-- | src/libudev/libudev-private.h | 1 | ||||
-rw-r--r-- | src/libudev/libudev.c | 8 |
4 files changed, 11 insertions, 12 deletions
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c index 637d064819..d80100cd61 100644 --- a/src/libudev/libudev-device-private.c +++ b/src/libudev/libudev-device-private.c @@ -130,8 +130,8 @@ int udev_device_update_db(struct udev_device *udev_device) mkdir_parents(filename_tmp, 0755); f = fopen(filename_tmp, "we"); if (f == NULL) { - udev_err(udev, "unable to create temporary db file '%s': %m\n", filename_tmp); - return -1; + udev_dbg(udev, "unable to create temporary db file '%s': %m\n", filename_tmp); + return -errno; } /* diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index 59698b85b7..890df9c595 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -121,7 +121,7 @@ static bool udev_has_devtmpfs(struct udev *udev) { r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0); if (r < 0) { if (errno != EOPNOTSUPP) - udev_err(udev, "name_to_handle_at on /dev: %m\n"); + udev_dbg(udev, "name_to_handle_at on /dev: %m\n"); return false; } @@ -190,7 +190,7 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c if (fd < 0) { udev_monitor->sock = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT); if (udev_monitor->sock == -1) { - udev_err(udev, "error getting socket: %m\n"); + udev_dbg(udev, "error getting socket: %m\n"); free(udev_monitor); return NULL; } @@ -407,14 +407,14 @@ _public_ int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor) if (err == 0) udev_monitor->snl.nl.nl_pid = snl.nl.nl_pid; } else { - udev_err(udev_monitor->udev, "bind failed: %m\n"); + udev_dbg(udev_monitor->udev, "bind failed: %m\n"); return -errno; } /* enable receiving of sender credentials */ err = setsockopt(udev_monitor->sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); if (err < 0) - udev_err(udev_monitor->udev, "setting SO_PASSCRED failed: %m\n"); + udev_dbg(udev_monitor->udev, "setting SO_PASSCRED failed: %m\n"); return 0; } @@ -648,7 +648,7 @@ retry: /* udev message needs proper version magic */ nlh = (struct udev_monitor_netlink_header *) buf; if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) { - udev_err(udev_monitor->udev, "unrecognized message signature (%x != %x)\n", + udev_dbg(udev_monitor->udev, "unrecognized message signature (%x != %x)\n", nlh->magic, htonl(UDEV_MONITOR_MAGIC)); udev_device_unref(udev_device); return NULL; diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h index 40673a6686..17803c2f43 100644 --- a/src/libudev/libudev-private.h +++ b/src/libudev/libudev-private.h @@ -41,7 +41,6 @@ } while (0) #define udev_dbg(udev, arg...) udev_log_cond(udev, LOG_DEBUG, ## arg) -#define udev_err(udev, arg...) udev_log_cond(udev, LOG_ERR, ## arg) /* libudev.c */ void udev_log(struct udev *udev, diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c index b1649b6514..6744658789 100644 --- a/src/libudev/libudev.c +++ b/src/libudev/libudev.c @@ -153,7 +153,7 @@ _public_ struct udev *udev_new(void) /* split key/value */ val = strchr(key, '='); if (val == NULL) { - udev_err(udev, "/etc/udev/udev.conf:%u: missing assignment, skipping line.\n", line_nr); + udev_dbg(udev, "/etc/udev/udev.conf:%u: missing assignment, skipping line.\n", line_nr); continue; } val[0] = '\0'; @@ -185,7 +185,7 @@ _public_ struct udev *udev_new(void) /* unquote */ if (val[0] == '"' || val[0] == '\'') { if (val[len-1] != val[0]) { - udev_err(udev, "/etc/udev/udev.conf:%u: inconsistent quoting, skipping line.\n", line_nr); + udev_dbg(udev, "/etc/udev/udev.conf:%u: inconsistent quoting, skipping line.\n", line_nr); continue; } val[len-1] = '\0'; @@ -197,7 +197,7 @@ _public_ struct udev *udev_new(void) prio = util_log_priority(val); if (prio < 0) - udev_err(udev, "/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.\n", line_nr, val); + udev_dbg(udev, "/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.\n", line_nr, val); else udev_set_log_priority(udev, prio); continue; @@ -212,7 +212,7 @@ _public_ struct udev *udev_new(void) prio = util_log_priority(env); if (prio < 0) - udev_err(udev, "$UDEV_LOG specifies invalid log level '%s', ignoring.\n", env); + udev_dbg(udev, "$UDEV_LOG specifies invalid log level '%s', ignoring.\n", env); else udev_set_log_priority(udev, prio); } |