summaryrefslogtreecommitdiff
path: root/src/console/consoled-terminal.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 11:58:34 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 12:04:41 +0100
commit0a1beeb64207eaa88ab9236787b1cbc2f704ae14 (patch)
tree50117277be2e2078d0373b944a30b4f09bb94443 /src/console/consoled-terminal.c
parentb4d23205f238e06aaa31264628e20669e714acad (diff)
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
Diffstat (limited to 'src/console/consoled-terminal.c')
-rw-r--r--src/console/consoled-terminal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/console/consoled-terminal.c b/src/console/consoled-terminal.c
index d091579aa5..7d0f646c7e 100644
--- a/src/console/consoled-terminal.c
+++ b/src/console/consoled-terminal.c
@@ -52,7 +52,7 @@ static int terminal_pty_fn(Pty *pty, void *userdata, unsigned int event, const v
case PTY_DATA:
r = term_screen_feed_text(t->screen, ptr, size);
if (r < 0)
- log_error("Cannot update screen state: %s", strerror(-r));
+ log_error_errno(-r, "Cannot update screen state: %m");
workspace_dirty(t->workspace);
break;
@@ -128,12 +128,12 @@ void terminal_resize(Terminal *t) {
if (t->pty) {
r = pty_resize(t->pty, width, height);
if (r < 0)
- log_error("Cannot resize pty: %s", strerror(-r));
+ log_error_errno(-r, "Cannot resize pty: %m");
}
r = term_screen_resize(t->screen, width, height);
if (r < 0)
- log_error("Cannot resize screen: %s", strerror(-r));
+ log_error_errno(-r, "Cannot resize screen: %m");
}
void terminal_run(Terminal *t) {
@@ -151,7 +151,7 @@ void terminal_run(Terminal *t) {
term_screen_get_width(t->screen),
term_screen_get_height(t->screen));
if (pid < 0) {
- log_error("Cannot fork PTY: %s", strerror(-pid));
+ log_error_errno(-pid, "Cannot fork PTY: %m");
return;
} else if (pid == 0) {
/* child */