diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2014-01-13 18:16:50 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-01-13 18:16:50 -0500 |
commit | e33d2cfc5e0bafb10eb82bb32776c41e558a026c (patch) | |
tree | 619ae0451cd40f169d740a02f26bf46a17c854b1 /src/udev/udev-event.c | |
parent | 248ea81923ce671979ccbe0bca5683d4239feb70 (diff) |
src/udev: bring up to date with upstream.
These commits were authored by
Zbigniew Jędrzejewski-Szmek
Tom Gundersen
Kay Sievers
Lennart Poettering
Shawn Landden
Daniel Buch
Martin Pitt
Karel Zak
Yang Zhiyong
Note: udev_builtin_net_setup_link has *not* been imported. Also
still missing from udev-builtin is udev_builtin_uaccess.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-event.c')
-rw-r--r-- | src/udev/udev-event.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 7867263b81..d4a54faf13 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -177,7 +177,7 @@ subst: from++; for (i = 0; from[i] != '}'; i++) { if (from[i] == '\0') { - log_error("missing closing brace for format '%s'\n", src); + log_error("missing closing brace for format '%s'", src); goto out; } } @@ -258,7 +258,7 @@ subst: cpos++; } if (i > 0) { - log_error("requested part of result string not found\n"); + log_error("requested part of result string not found"); break; } strscpy(tmp, sizeof(tmp), cpos); @@ -281,7 +281,7 @@ subst: int count; if (attr == NULL) { - log_error("missing file parameter for attr\n"); + log_error("missing file parameter for attr"); break; } @@ -308,7 +308,7 @@ subst: vbuf[len] = '\0'; count = util_replace_chars(vbuf, UDEV_ALLOWED_CHARS_INPUT); if (count > 0) - log_debug("%i character(s) replaced\n" , count); + log_debug("%i character(s) replaced" , count); l = strpcpy(&s, l, vbuf); break; } @@ -366,7 +366,7 @@ subst: break; } default: - log_error("unknown substitution type=%i\n", type); + log_error("unknown substitution type=%i", type); break; } } @@ -393,7 +393,7 @@ static int spawn_exec(struct udev_event *event, dup2(fd, STDERR_FILENO); close(fd); } else { - log_error("open /dev/null failed: %m\n"); + log_error("open /dev/null failed: %m"); } /* connect pipes to std{out,err} */ @@ -417,7 +417,7 @@ static int spawn_exec(struct udev_event *event, /* exec failed */ err = -errno; - log_error("failed to execute '%s' '%s': %m\n", argv[0], cmd); + log_error("failed to execute '%s' '%s': %m", argv[0], cmd); return err; } @@ -436,7 +436,7 @@ static void spawn_read(struct udev_event *event, fd_ep = epoll_create1(EPOLL_CLOEXEC); if (fd_ep < 0) { - log_error("error creating epoll fd: %m\n"); + log_error("error creating epoll fd: %m"); goto out; } @@ -445,7 +445,7 @@ static void spawn_read(struct udev_event *event, ep_outpipe.events = EPOLLIN; ep_outpipe.data.ptr = &fd_stdout; if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_stdout, &ep_outpipe) < 0) { - log_error("fail to add fd to epoll: %m\n"); + log_error("fail to add fd to epoll: %m"); goto out; } } @@ -455,7 +455,7 @@ static void spawn_read(struct udev_event *event, ep_errpipe.events = EPOLLIN; ep_errpipe.data.ptr = &fd_stderr; if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_stderr, &ep_errpipe) < 0) { - log_error("fail to add fd to epoll: %m\n"); + log_error("fail to add fd to epoll: %m"); goto out; } } @@ -472,7 +472,7 @@ static void spawn_read(struct udev_event *event, age_usec = now(CLOCK_MONOTONIC) - event->birth_usec; if (age_usec >= event->timeout_usec) { - log_error("timeout '%s'\n", cmd); + log_error("timeout '%s'", cmd); goto out; } timeout = ((event->timeout_usec - age_usec) / 1000) + 1000; @@ -484,11 +484,11 @@ static void spawn_read(struct udev_event *event, if (fdcount < 0) { if (errno == EINTR) continue; - log_error("failed to poll: %m\n"); + log_error("failed to poll: %m"); goto out; } if (fdcount == 0) { - log_error("timeout '%s'\n", cmd); + log_error("timeout '%s'", cmd); goto out; } @@ -510,7 +510,7 @@ static void spawn_read(struct udev_event *event, memcpy(&result[respos], buf, count); respos += count; } else { - log_error("'%s' ressize %zd too short\n", cmd, ressize); + log_error("'%s' ressize %zd too short", cmd, ressize); } } @@ -522,12 +522,12 @@ static void spawn_read(struct udev_event *event, pos = buf; while ((line = strsep(&pos, "\n"))) { if (pos != NULL || line[0] != '\0') - log_debug("'%s'(%s) '%s'\n", cmd, *fd == fd_stdout ? "out" : "err" , line); + log_debug("'%s'(%s) '%s'", cmd, *fd == fd_stdout ? "out" : "err" , line); } } } else if (ev[i].events & EPOLLHUP) { if (epoll_ctl(fd_ep, EPOLL_CTL_DEL, *fd, NULL) < 0) { - log_error("failed to remove fd from epoll: %m\n"); + log_error("failed to remove fd from epoll: %m"); goto out; } *fd = -1; @@ -572,11 +572,11 @@ static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid) if (errno == EINTR) continue; err = -errno; - log_error("failed to poll: %m\n"); + log_error("failed to poll: %m"); goto out; } if (fdcount == 0) { - log_error("timeout: killing '%s' [%u]\n", cmd, pid); + log_error("timeout: killing '%s' [%u]", cmd, pid); kill(pid, SIGKILL); } @@ -597,20 +597,20 @@ static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid) if (waitpid(pid, &status, WNOHANG) < 0) break; if (WIFEXITED(status)) { - log_debug("'%s' [%u] exit with return code %i\n", cmd, pid, WEXITSTATUS(status)); + log_debug("'%s' [%u] exit with return code %i", cmd, pid, WEXITSTATUS(status)); if (WEXITSTATUS(status) != 0) err = -1; } else if (WIFSIGNALED(status)) { - log_error("'%s' [%u] terminated by signal %i (%s)\n", cmd, pid, WTERMSIG(status), strsignal(WTERMSIG(status))); + log_error("'%s' [%u] terminated by signal %i (%s)", cmd, pid, WTERMSIG(status), strsignal(WTERMSIG(status))); err = -1; } else if (WIFSTOPPED(status)) { - log_error("'%s' [%u] stopped\n", cmd, pid); + log_error("'%s' [%u] stopped", cmd, pid); err = -1; } else if (WIFCONTINUED(status)) { - log_error("'%s' [%u] continued\n", cmd, pid); + log_error("'%s' [%u] continued", cmd, pid); err = -1; } else { - log_error("'%s' [%u] exit with status 0x%04x\n", cmd, pid, status); + log_error("'%s' [%u] exit with status 0x%04x", cmd, pid, status); err = -1; } pid = 0; @@ -676,14 +676,14 @@ int udev_event_spawn(struct udev_event *event, if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) { if (pipe2(outpipe, O_NONBLOCK) != 0) { err = -errno; - log_error("pipe failed: %m\n"); + log_error("pipe failed: %m"); goto out; } } if (udev_get_log_priority(udev) >= LOG_INFO) { if (pipe2(errpipe, O_NONBLOCK) != 0) { err = -errno; - log_error("pipe failed: %m\n"); + log_error("pipe failed: %m"); goto out; } } @@ -713,14 +713,14 @@ int udev_event_spawn(struct udev_event *event, errpipe[READ_END] = -1; } - log_debug("starting '%s'\n", cmd); + log_debug("starting '%s'", cmd); spawn_exec(event, cmd, argv, envp, sigmask, outpipe[WRITE_END], errpipe[WRITE_END]); _exit(2 ); case -1: - log_error("fork of '%s' failed: %m\n", cmd); + log_error("fork of '%s' failed: %m", cmd); err = -1; goto out; default: @@ -944,7 +944,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, err = rename_netif(event); #endif if (err == 0) { - log_debug("renamed netif to '%s'\n", finalifname); + log_debug("renamed netif to '%s'", finalifname); /* remember old name */ udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); @@ -957,7 +957,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, strscpy(pos, sizeof(syspath) - (pos - syspath), finalifname); udev_device_set_syspath(event->dev, syspath); udev_device_add_property(dev, "INTERFACE", udev_device_get_sysname(dev)); - log_debug("changed devpath to '%s'\n", udev_device_get_devpath(dev)); + log_debug("changed devpath to '%s'", udev_device_get_devpath(dev)); } } } @@ -1027,7 +1027,7 @@ void udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) char **envp; if (event->exec_delay > 0) { - log_debug("delay execution of '%s'\n", program); + log_debug("delay execution of '%s'", program); sleep(event->exec_delay); } |