diff options
-rw-r--r-- | src/libudev/libudev-device-private.c | 4 | ||||
-rw-r--r-- | src/libudev/libudev-device.c | 10 | ||||
-rw-r--r-- | src/libudev/libudev-hwdb.c | 10 | ||||
-rw-r--r-- | src/libudev/libudev-monitor.c | 32 | ||||
-rw-r--r-- | src/libudev/libudev-util.c | 4 | ||||
-rw-r--r-- | src/libudev/libudev.c | 6 | ||||
-rw-r--r-- | src/udev/udev-event.c | 18 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 10 | ||||
-rw-r--r-- | src/udev/udevd.c | 4 |
9 files changed, 49 insertions, 49 deletions
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c index df1fc0c9bf..aa3b2270e0 100644 --- a/src/libudev/libudev-device-private.c +++ b/src/libudev/libudev-device-private.c @@ -129,7 +129,7 @@ int udev_device_update_db(struct udev_device *udev_device) mkdir_parents(filename_tmp, 0755); f = fopen(filename_tmp, "we"); if (f == NULL) { - log_debug("unable to create temporary db file '%s': %m\n", filename_tmp); + log_debug("unable to create temporary db file '%s': %m", filename_tmp); return -errno; } @@ -171,7 +171,7 @@ int udev_device_update_db(struct udev_device *udev_device) r = rename(filename_tmp, filename); if (r < 0) return -1; - log_debug("created %s file '%s' for '%s'\n", has_info ? "db" : "empty", + log_debug("created %s file '%s' for '%s'", has_info ? "db" : "empty", filename, udev_device_get_devpath(udev_device)); return 0; } diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index 37e75d280f..fc7d928721 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -535,7 +535,7 @@ int udev_device_read_db(struct udev_device *udev_device, const char *dbfile) f = fopen(dbfile, "re"); if (f == NULL) { - log_debug("no db file to read %s: %m\n", dbfile); + log_debug("no db file to read %s: %m", dbfile); return -errno; } @@ -577,7 +577,7 @@ int udev_device_read_db(struct udev_device *udev_device, const char *dbfile) } fclose(f); - log_debug("device %p filled with db file data\n", udev_device); + log_debug("device %p filled with db file data", udev_device); return 0; } @@ -699,7 +699,7 @@ _public_ struct udev_device *udev_device_new_from_syspath(struct udev *udev, con /* path starts in sys */ if (!startswith(syspath, "/sys")) { - log_debug("not in sys :%s\n", syspath); + log_debug("not in sys :%s", syspath); errno = EINVAL; return NULL; } @@ -734,7 +734,7 @@ _public_ struct udev_device *udev_device_new_from_syspath(struct udev *udev, con return NULL; udev_device_set_syspath(udev_device, path); - log_debug("device %p has devpath '%s'\n", udev_device, udev_device_get_devpath(udev_device)); + log_debug("device %p has devpath '%s'", udev_device, udev_device_get_devpath(udev_device)); return udev_device; } @@ -966,7 +966,7 @@ _public_ struct udev_device *udev_device_new_from_environment(struct udev *udev) udev_device_add_property_from_string_parse(udev_device, environ[i]); if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { - log_debug("missing values, invalid device\n"); + log_debug("missing values, invalid device"); udev_device_unref(udev_device); udev_device = NULL; } diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c index 3773f8f868..09e7c337b4 100644 --- a/src/libudev/libudev-hwdb.c +++ b/src/libudev/libudev-hwdb.c @@ -303,12 +303,12 @@ _public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) { return NULL; } - log_debug("=== trie on-disk ===\n"); + log_debug("=== trie on-disk ==="); log_debug("tool version: %"PRIu64, le64toh(hwdb->head->tool_version)); - log_debug("file size: %8"PRIu64" bytes\n", hwdb->st.st_size); - log_debug("header size %8"PRIu64" bytes\n", le64toh(hwdb->head->header_size)); - log_debug("strings %8"PRIu64" bytes\n", le64toh(hwdb->head->strings_len)); - log_debug("nodes %8"PRIu64" bytes\n", le64toh(hwdb->head->nodes_len)); + log_debug("file size: %8"PRIu64" bytes", hwdb->st.st_size); + log_debug("header size %8"PRIu64" bytes", le64toh(hwdb->head->header_size)); + log_debug("strings %8"PRIu64" bytes", le64toh(hwdb->head->strings_len)); + log_debug("nodes %8"PRIu64" bytes", le64toh(hwdb->head->nodes_len)); return hwdb; } diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index 366981abe2..6335fcc6cc 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) - log_debug("name_to_handle_at on /dev: %m\n"); + log_debug("name_to_handle_at on /dev: %m"); return false; } @@ -174,7 +174,7 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c * will not receive any messages. */ if (access("/run/udev/control", F_OK) < 0 && !udev_has_devtmpfs(udev)) { - log_debug("the udev service seems not to be active, disable the monitor\n"); + log_debug("the udev service seems not to be active, disable the monitor"); group = UDEV_MONITOR_NONE; } else group = UDEV_MONITOR_UDEV; @@ -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) { - log_debug("error getting socket: %m\n"); + log_debug("error getting socket: %m"); 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 { - log_debug("bind failed: %m\n"); + log_debug("bind failed: %m"); return -errno; } /* enable receiving of sender credentials */ err = setsockopt(udev_monitor->sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); if (err < 0) - log_debug("setting SO_PASSCRED failed: %m\n"); + log_debug("setting SO_PASSCRED failed: %m"); return 0; } @@ -602,12 +602,12 @@ retry: buflen = recvmsg(udev_monitor->sock, &smsg, 0); if (buflen < 0) { if (errno != EINTR) - log_debug("unable to receive message\n"); + log_debug("unable to receive message"); return NULL; } if (buflen < 32 || (size_t)buflen >= sizeof(buf)) { - log_debug("invalid message length\n"); + log_debug("invalid message length"); return NULL; } @@ -615,12 +615,12 @@ retry: /* unicast message, check if we trust the sender */ if (udev_monitor->snl_trusted_sender.nl.nl_pid == 0 || snl.nl.nl_pid != udev_monitor->snl_trusted_sender.nl.nl_pid) { - log_debug("unicast netlink message ignored\n"); + log_debug("unicast netlink message ignored"); return NULL; } } else if (snl.nl.nl_groups == UDEV_MONITOR_KERNEL) { if (snl.nl.nl_pid > 0) { - log_debug("multicast kernel netlink message from pid %d ignored\n", + log_debug("multicast kernel netlink message from pid %d ignored", snl.nl.nl_pid); return NULL; } @@ -628,13 +628,13 @@ retry: cmsg = CMSG_FIRSTHDR(&smsg); if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) { - log_debug("no sender credentials received, message ignored\n"); + log_debug("no sender credentials received, message ignored"); return NULL; } cred = (struct ucred *)CMSG_DATA(cmsg); if (cred->uid != 0) { - log_debug("sender uid=%d, message ignored\n", cred->uid); + log_debug("sender uid=%d, message ignored", cred->uid); return NULL; } @@ -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)) { - log_debug("unrecognized message signature (%x != %x)\n", + log_debug("unrecognized message signature (%x != %x)", nlh->magic, htonl(UDEV_MONITOR_MAGIC)); udev_device_unref(udev_device); return NULL; @@ -666,14 +666,14 @@ retry: /* kernel message with header */ bufpos = strlen(buf) + 1; if ((size_t)bufpos < sizeof("a@/d") || bufpos >= buflen) { - log_debug("invalid message length\n"); + log_debug("invalid message length"); udev_device_unref(udev_device); return NULL; } /* check message header */ if (strstr(buf, "@/") == NULL) { - log_debug("unrecognized message header\n"); + log_debug("unrecognized message header"); udev_device_unref(udev_device); return NULL; } @@ -694,7 +694,7 @@ retry: } if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { - log_debug("missing values, invalid device\n"); + log_debug("missing values, invalid device"); udev_device_unref(udev_device); return NULL; } @@ -778,7 +778,7 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, smsg.msg_name = &udev_monitor->snl_destination; smsg.msg_namelen = sizeof(struct sockaddr_nl); count = sendmsg(udev_monitor->sock, &smsg, 0); - log_debug("passed %zi bytes to netlink monitor %p\n", count, udev_monitor); + log_debug("passed %zi bytes to netlink monitor %p", count, udev_monitor); return count; } diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index 8f3b6ff8aa..e626aad53e 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -96,7 +96,7 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string, strscpy(result, maxsize, val); else result[0] = '\0'; - log_debug("value '[%s/%s]%s' is '%s'\n", subsys, sysname, attr, result); + log_debug("value '[%s/%s]%s' is '%s'", subsys, sysname, attr, result); } else { size_t l; char *s; @@ -105,7 +105,7 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string, l = strpcpyl(&s, maxsize, udev_device_get_syspath(dev), NULL); if (attr != NULL) strpcpyl(&s, l, "/", attr, NULL); - log_debug("path '[%s/%s]%s' is '%s'\n", subsys, sysname, attr, result); + log_debug("path '[%s/%s]%s' is '%s'", subsys, sysname, attr, result); } udev_device_unref(dev); return 0; diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c index 3ce13d2f76..e656b352c6 100644 --- a/src/libudev/libudev.c +++ b/src/libudev/libudev.c @@ -124,7 +124,7 @@ _public_ struct udev *udev_new(void) { /* split key/value */ val = strchr(key, '='); if (val == NULL) { - log_debug(UDEV_CONF_FILE ":%u: missing assignment, skipping line.\n", line_nr); + log_debug(UDEV_CONF_FILE ":%u: missing assignment, skipping line.", line_nr); continue; } val[0] = '\0'; @@ -156,7 +156,7 @@ _public_ struct udev *udev_new(void) { /* unquote */ if (val[0] == '"' || val[0] == '\'') { if (val[len-1] != val[0]) { - log_debug(UDEV_CONF_FILE ":%u: inconsistent quoting, skipping line.\n", line_nr); + log_debug(UDEV_CONF_FILE ":%u: inconsistent quoting, skipping line.", line_nr); continue; } val[len-1] = '\0'; @@ -168,7 +168,7 @@ _public_ struct udev *udev_new(void) { prio = util_log_priority(val); if (prio < 0) - log_debug("/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.\n", line_nr, val); + log_debug("/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.", line_nr, val); else log_set_max_level(prio); continue; diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index fc4a2ec848..afcf262ebb 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -784,7 +784,7 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char * sk = socket(PF_INET, SOCK_DGRAM, 0); if (sk < 0) { err = -errno; - log_error("error opening socket: %m\n"); + log_error("error opening socket: %m"); return err; } @@ -798,11 +798,11 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char * int loop; if (err == 0) { - log_info("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname); + log_info("renamed network interface %s to %s", ifr.ifr_name, ifr.ifr_newname); goto out; } /* keep trying if the destination interface name already exists */ - log_debug("collision on rename of network interface %s to %s , retrying until timeout\n", + log_debug("collision on rename of network interface %s to %s , retrying until timeout", ifr.ifr_name, ifr.ifr_newname); err = -errno; @@ -818,7 +818,7 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char * err = ioctl(sk, SIOCSIFNAME, &ifr); if (err == 0) { - log_info("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname); + log_info("renamed network interface %s to %s", ifr.ifr_name, ifr.ifr_newname); break; } err = -errno; @@ -828,13 +828,13 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char * out: if (err < 0) - log_error("error changing net interface name %s to %s: %m\n", ifr.ifr_name, ifr.ifr_newname); + log_error("error changing net interface name %s to %s: %m", ifr.ifr_name, ifr.ifr_newname); #else if (err >= 0) { - log_info("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname); + log_info("renamed network interface %s to %s", ifr.ifr_name, ifr.ifr_newname); } else { err = -errno; - log_error("error changing net interface name %s to %s: %m\n", ifr.ifr_name, ifr.ifr_newname); + log_error("error changing net interface name %s to %s: %m", ifr.ifr_name, ifr.ifr_newname); } #endif @@ -961,9 +961,9 @@ void udev_event_execute_rules(struct udev_event *event, r = rename_netif_dev_fromname_toname(dev,udev_device_get_sysname(dev),newifname); if (r == 0) { finalifname = newifname; - log_debug("renamed netif to '%s' for collision avoidance\n", newifname); + log_debug("renamed netif to '%s' for collision avoidance", newifname); } else { - log_error("could not rename netif to '%s' for collision avoidance\n",newifname); + log_error("could not rename netif to '%s' for collision avoidance",newifname); } } /* rename it now to its final target if its not already there */ diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 411d4a4ac1..7816d9dc7b 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1420,12 +1420,12 @@ static int add_rule(struct udev_rules *rules, char *line, } else { if (streq(value, "%k")) { log_error("NAME=\"%%k\" is ignored, because it breaks kernel supplied names, " - "please remove it from %s:%u\n", filename, lineno); + "please remove it from %s:%u", filename, lineno); continue; } if (value[0] == '\0') { log_debug("NAME=\"\" is ignored, because udev will not delete any device nodes, " - "please remove it from %s:%u\n", filename, lineno); + "please remove it from %s:%u", filename, lineno); continue; } rule_add_key(&rule_tmp, TK_A_NAME, op, value, NULL); @@ -1916,9 +1916,9 @@ int udev_rules_assigning_name_to(struct udev_rules *rules, const char *match_nam strscpy(name_str,UTIL_PATH_SIZE,name); count = util_replace_chars(name_str, "/"); if (count > 0) - log_debug("%i character(s) replaced\n", count); + log_debug("%i character(s) replaced", count); if (streq(name_str,match_name)) { - log_debug("found a match! NAME assigns %s in: %s:%u\n", + log_debug("found a match! NAME assigns %s in: %s:%u", name, rules_str(rules, rule->rule.filename_off), rule->rule.filename_line); @@ -2518,7 +2518,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, if (major(udev_device_get_devnum(event->dev)) && (!streq(name_str, udev_device_get_devnode(event->dev) + strlen("/dev/")))) { log_error("NAME=\"%s\" ignored, kernel device nodes " - "can not be renamed; please fix it in %s:%u\n", name, + "can not be renamed; please fix it in %s:%u", name, rules_str(rules, rule->rule.filename_off), rule->rule.filename_line); break; } diff --git a/src/udev/udevd.c b/src/udev/udevd.c index fad0b11179..f2898d0dfa 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -966,7 +966,7 @@ static void static_dev_create_from_modules(struct udev *udev) { strscpyl(filename, sizeof(filename), "/dev/", devname, NULL); mkdir_parents_label(filename, 0755); mac_selinux_create_file_prepare(filename, mode); - log_debug("mknod '%s' %c%u:%u\n", filename, type, maj, min); + log_debug("mknod '%s' %c%u:%u", filename, type, maj, min); if (mknod(filename, mode, makedev(maj, min)) < 0 && errno == EEXIST) utimensat(AT_FDCWD, filename, NULL, 0); mac_selinux_create_file_clear(); @@ -1233,7 +1233,7 @@ int main(int argc, char *argv[]) { udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024); - log_info("starting version " VERSION "\n"); + log_info("starting version " VERSION); udev_builtin_init(udev); |