X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournald-console.c;h=35da52af2afa7a663ba24ee1074339f334ff55d2;hb=020d59000f86b3d98be763eaee6a2671f0427e46;hp=1ee3afeacc37010b7411e34019a3e6250a508417;hpb=ad79565d6b37bcc93cf773a39b975e5b85d122da;p=elogind.git diff --git a/src/journal/journald-console.c b/src/journal/journald-console.c index 1ee3afeac..35da52af2 100644 --- a/src/journal/journald-console.c +++ b/src/journal/journald-console.c @@ -55,7 +55,7 @@ void server_forward_console( struct timespec ts; char tbuf[4 + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1]; int n = 0, fd; - char *ident_buf = NULL; + _cleanup_free_ char *ident_buf = NULL; const char *tty; assert(s); @@ -100,15 +100,12 @@ void server_forward_console( fd = open_terminal(tty, O_WRONLY|O_NOCTTY|O_CLOEXEC); if (fd < 0) { - log_debug("Failed to open %s for logging: %s", tty, strerror(errno)); - goto finish; + log_debug("Failed to open %s for logging: %m", tty); + return; } if (writev(fd, iovec, n) < 0) - log_debug("Failed to write to %s for logging: %s", tty, strerror(errno)); + log_debug("Failed to write to %s for logging: %m", tty); close_nointr_nofail(fd); - -finish: - free(ident_buf); }