summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/subterm.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:29:59 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:49:27 +0100
commit56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch)
tree4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/libsystemd-terminal/subterm.c
parent895b3a7b44fe7ca2f260986be2a877ff56a72718 (diff)
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
Diffstat (limited to 'src/libsystemd-terminal/subterm.c')
-rw-r--r--src/libsystemd-terminal/subterm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsystemd-terminal/subterm.c b/src/libsystemd-terminal/subterm.c
index 920b661af4..f2651b24ac 100644
--- a/src/libsystemd-terminal/subterm.c
+++ b/src/libsystemd-terminal/subterm.c
@@ -103,7 +103,7 @@ static int output_winch(Output *o) {
r = ioctl(o->fd, TIOCGWINSZ, &wsz);
if (r < 0) {
- log_error("error: cannot read window-size: %m");
+ log_error_errno(errno, "error: cannot read window-size: %m");
return -errno;
}
@@ -707,7 +707,7 @@ static int terminal_io_fn(sd_event_source *source, int fd, uint32_t revents, voi
if (errno == EAGAIN || errno == EINTR)
return 0;
- log_error("error: cannot read from TTY (%d): %m", -errno);
+ log_error_errno(errno, "error: cannot read from TTY (%d): %m", -errno);
return -errno;
}
@@ -823,13 +823,13 @@ static int terminal_new(Terminal **out, int in_fd, int out_fd) {
r = tcgetattr(in_fd, &in_attr);
if (r < 0) {
- log_error("error: tcgetattr() (%d): %m", -errno);
+ log_error_errno(errno, "error: tcgetattr() (%d): %m", -errno);
return -errno;
}
r = tcgetattr(out_fd, &out_attr);
if (r < 0) {
- log_error("error: tcgetattr() (%d): %m", -errno);
+ log_error_errno(errno, "error: tcgetattr() (%d): %m", -errno);
return -errno;
}
@@ -955,7 +955,7 @@ static int terminal_run(Terminal *t) {
setenv("COLORTERM", "systemd-subterm", 1);
execve(argv[0], argv, environ);
- log_error("error: cannot exec %s (%d): %m", argv[0], -errno);
+ log_error_errno(errno, "error: cannot exec %s (%d): %m", argv[0], -errno);
_exit(1);
}