chiark / gitweb /
treewide: drop unnecessary trailing \n in log_*() calls
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 28 Nov 2014 13:26:31 +0000 (14:26 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Fri, 28 Nov 2014 13:26:31 +0000 (14:26 +0100)
12 files changed:
src/libsystemd/sd-resolve/test-resolve.c
src/libudev/libudev-device-private.c
src/libudev/libudev-device.c
src/libudev/libudev-hwdb.c
src/libudev/libudev-monitor.c
src/libudev/libudev-util.c
src/libudev/libudev.c
src/locale/localectl.c
src/timesync/timesyncd-manager.c
src/udev/udev-event.c
src/udev/udev-rules.c
src/udev/udevd.c

index c6c3bfb..b7f8640 100644 (file)
@@ -43,7 +43,7 @@ static int getaddrinfo_handler(sd_resolve_query *q, int ret, const struct addrin
         assert(q);
 
         if (ret != 0) {
-                log_error("getaddrinfo error: %s %i\n", gai_strerror(ret), ret);
+                log_error("getaddrinfo error: %s %i", gai_strerror(ret), ret);
                 return 0;
         }
 
@@ -63,7 +63,7 @@ static int getnameinfo_handler(sd_resolve_query *q, int ret, const char *host, c
         assert(q);
 
         if (ret != 0) {
-                log_error("getnameinfo error: %s %i\n", gai_strerror(ret), ret);
+                log_error("getnameinfo error: %s %i", gai_strerror(ret), ret);
                 return 0;
         }
 
@@ -80,12 +80,12 @@ static int res_handler(sd_resolve_query *q, int ret, unsigned char *answer, void
         assert(q);
 
         if (ret < 0) {
-                log_error("res_query() error: %s %i\n", strerror(errno), errno);
+                log_error("res_query() error: %s %i", strerror(errno), errno);
                 return 0;
         }
 
         if (ret == 0) {
-                log_error("No reply for SRV lookup\n");
+                log_error("No reply for SRV lookup");
                 return 0;
         }
 
@@ -146,18 +146,18 @@ int main(int argc, char *argv[]) {
         /* Make a name -> address query */
         r = sd_resolve_getaddrinfo(resolve, &q1, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints, getaddrinfo_handler, NULL);
         if (r < 0)
-                log_error("sd_resolve_getaddrinfo(): %s\n", strerror(-r));
+                log_error("sd_resolve_getaddrinfo(): %s", strerror(-r));
 
         /* Make an address -> name query */
         sa.sin_addr.s_addr = inet_addr(argc >= 3 ? argv[2] : "193.99.144.71");
         r = sd_resolve_getnameinfo(resolve, &q2, (struct sockaddr*) &sa, sizeof(sa), 0, SD_RESOLVE_GET_BOTH, getnameinfo_handler, NULL);
         if (r < 0)
-                log_error("sd_resolve_getnameinfo(): %s\n", strerror(-r));
+                log_error("sd_resolve_getnameinfo(): %s", strerror(-r));
 
         /* Make a res_query() call */
         r = sd_resolve_res_query(resolve, &q3, "_xmpp-client._tcp.gmail.com", C_IN, T_SRV, res_handler, NULL);
         if (r < 0)
-                log_error("sd_resolve_res_query(): %s\n", strerror(-r));
+                log_error("sd_resolve_res_query(): %s", strerror(-r));
 
         /* Wait until the three queries are completed */
         while (sd_resolve_query_is_done(q1) == 0 ||
@@ -166,7 +166,7 @@ int main(int argc, char *argv[]) {
 
                 r = sd_resolve_wait(resolve, (uint64_t) -1);
                 if (r < 0) {
-                        log_error("sd_resolve_wait(): %s\n", strerror(-r));
+                        log_error("sd_resolve_wait(): %s", strerror(-r));
                         assert_not_reached("sd_resolve_wait() failed");
                 }
         }
index df1fc0c..aa3b227 100644 (file)
@@ -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;
 }
index 37e75d2..fc7d928 100644 (file)
@@ -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;
         }
index 5ab821f..1d0d407 100644 (file)
@@ -322,12 +322,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;
 }
 
index 893ecb4..bdb5516 100644 (file)
@@ -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;
 }
 
index 361c21f..291829e 100644 (file)
@@ -93,7 +93,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;
@@ -102,7 +102,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;
index c237db5..8785f22 100644 (file)
@@ -124,7 +124,7 @@ _public_ struct udev *udev_new(void) {
                         /* split key/value */
                         val = strchr(key, '=');
                         if (val == NULL) {
-                                log_debug("/etc/udev/udev.conf:%u: missing assignment,  skipping line.\n", line_nr);
+                                log_debug("/etc/udev/udev.conf:%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("/etc/udev/udev.conf:%u: inconsistent quoting, skipping line.\n", line_nr);
+                                        log_debug("/etc/udev/udev.conf:%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;
index 333b458..211808b 100644 (file)
@@ -118,11 +118,11 @@ static void print_overriden_variables(void) {
                 if (variables[j]) {
                         if (print_warning) {
                                 log_warning("Warning: Settings on kernel command line override system locale settings in /etc/locale.conf.\n"
-                                            "  Command Line: %s=%s\n", locale_variable_to_string(j), variables[j]);
+                                            "  Command Line: %s=%s", locale_variable_to_string(j), variables[j]);
 
                                 print_warning = false;
                         } else
-                                log_warning("                %s=%s\n", locale_variable_to_string(j), variables[j]);
+                                log_warning("                %s=%s", locale_variable_to_string(j), variables[j]);
                 }
  finish:
         for (j = 0; j < _VARIABLE_LC_MAX; j++)
index 8e4c0f3..8559438 100644 (file)
@@ -353,7 +353,7 @@ static int manager_adjust_clock(Manager *m, double offset, int leap_sec) {
                 tmx.constant = log2i(m->poll_interval_usec / USEC_PER_SEC) - 4;
                 tmx.maxerror = 0;
                 tmx.esterror = 0;
-                log_debug("  adjust (slew): %+.3f sec\n", offset);
+                log_debug("  adjust (slew): %+.3f sec", offset);
         } else {
                 tmx.modes = ADJ_STATUS | ADJ_NANO | ADJ_SETOFFSET;
 
@@ -368,7 +368,7 @@ static int manager_adjust_clock(Manager *m, double offset, int leap_sec) {
                 }
 
                 m->jumped = true;
-                log_debug("  adjust (jump): %+.3f sec\n", offset);
+                log_debug("  adjust (jump): %+.3f sec", offset);
         }
 
         /*
index 34f5348..7799a20 100644 (file)
@@ -781,7 +781,7 @@ static int rename_netif(struct udev_event *event) {
                 return r;
         }
 
-        log_debug("renamed network interface '%s' to '%s'\n", oldname, name);
+        log_debug("renamed network interface '%s' to '%s'", oldname, name);
 
         return 0;
 }
index eb56e27..37508fa 100644 (file)
@@ -474,9 +474,9 @@ static uid_t add_uid(struct udev_rules *rules, const char *owner) {
         r = get_user_creds(&owner, &uid, NULL, NULL, NULL);
         if (r < 0) {
                 if (r == -ENOENT || r == -ESRCH)
-                        log_error("specified user '%s' unknown\n", owner);
+                        log_error("specified user '%s' unknown", owner);
                 else
-                        log_error("error resolving user '%s': %s\n", owner, strerror(-r));
+                        log_error("error resolving user '%s': %s", owner, strerror(-r));
         }
 
         /* grow buffer if needed */
@@ -521,9 +521,9 @@ static gid_t add_gid(struct udev_rules *rules, const char *group) {
         r = get_group_creds(&group, &gid);
         if (r < 0) {
                 if (r == -ENOENT || r == -ESRCH)
-                        log_error("specified group '%s' unknown\n", group);
+                        log_error("specified group '%s' unknown", group);
                 else
-                        log_error("error resolving group '%s': %s\n", group, strerror(-r));
+                        log_error("error resolving group '%s': %s", group, strerror(-r));
         }
 
         /* grow buffer if needed */
@@ -1072,7 +1072,7 @@ static int add_rule(struct udev_rules *rules, char *line,
                                 _cleanup_free_ char *tmp;
 
                                 tmp = cescape(buf);
-                                log_error("invalid key/value pair in file %s on line %u, starting at character %tu ('%s')\n",
+                                log_error("invalid key/value pair in file %s on line %u, starting at character %tu ('%s')",
                                           filename, lineno, linepos - line + 1, tmp);
                                 if (linepos[1] == '#')
                                         log_error("hint: comments can only start at beginning of line");
@@ -2277,9 +2277,9 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
                         r = get_user_creds(&ow, &event->uid, NULL, NULL, NULL);
                         if (r < 0) {
                                 if (r == -ENOENT || r == -ESRCH)
-                                        log_error("specified user '%s' unknown\n", owner);
+                                        log_error("specified user '%s' unknown", owner);
                                 else
-                                        log_error("error resolving user '%s': %s\n", owner, strerror(-r));
+                                        log_error("error resolving user '%s': %s", owner, strerror(-r));
 
                                 event->uid = 0;
                         }
@@ -2303,9 +2303,9 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
                         r = get_group_creds(&gr, &event->gid);
                         if (r < 0) {
                                 if (r == -ENOENT || r == -ESRCH)
-                                        log_error("specified group '%s' unknown\n", group);
+                                        log_error("specified group '%s' unknown", group);
                                 else
-                                        log_error("error resolving group '%s': %s\n", group, strerror(-r));
+                                        log_error("error resolving group '%s': %s", group, strerror(-r));
 
                                 event->gid = 0;
                         }
index d1cc778..a6258e7 100644 (file)
@@ -1227,7 +1227,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);