chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some modernizations
[elogind.git]
/
src
/
journal
/
journald-console.c
diff --git
a/src/journal/journald-console.c
b/src/journal/journald-console.c
index 04c4424a46c7c72f5344e051a10b8df56f5e4305..35da52af2afa7a663ba24ee1074339f334ff55d2 100644
(file)
--- 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;
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);
const char *tty;
assert(s);
@@
-101,14
+101,11
@@
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: %m", tty);
fd = open_terminal(tty, O_WRONLY|O_NOCTTY|O_CLOEXEC);
if (fd < 0) {
log_debug("Failed to open %s for logging: %m", tty);
-
goto finish
;
+
return
;
}
if (writev(fd, iovec, n) < 0)
log_debug("Failed to write to %s for logging: %m", tty);
close_nointr_nofail(fd);
}
if (writev(fd, iovec, n) < 0)
log_debug("Failed to write to %s for logging: %m", tty);
close_nointr_nofail(fd);
-
-finish:
- free(ident_buf);
}
}