chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
execute: close inherited fds earlier
[elogind.git]
/
src
/
utmp-wtmp.c
diff --git
a/src/utmp-wtmp.c
b/src/utmp-wtmp.c
index d7cda82d5a6dfc98669a7d89b9bf33aee0385a09..45da79c681c8e3d92bf1abf2db75630593462ae6 100644
(file)
--- a/
src/utmp-wtmp.c
+++ b/
src/utmp-wtmp.c
@@
-296,12
+296,14
@@
int utmp_wall(const char *message) {
time_t t;
if (!(hn = gethostname_malloc()) ||
time_t t;
if (!(hn = gethostname_malloc()) ||
- !(un = getlogname_malloc()) ||
- !(tty = getttyname_malloc())) {
+ !(un = getlogname_malloc())) {
r = -ENOMEM;
goto finish;
}
r = -ENOMEM;
goto finish;
}
+ if ((r = getttyname_malloc(&tty)) < 0)
+ goto finish;
+
time(&t);
assert_se(ctime_r(&t, date));
delete_chars(date, "\n\r");
time(&t);
assert_se(ctime_r(&t, date));
delete_chars(date, "\n\r");