summaryrefslogtreecommitdiffstats
path: root/login-utils/last.c
diff options
context:
space:
mode:
authorSami Kerola2012-04-04 19:58:34 +0200
committerSami Kerola2012-04-04 19:58:34 +0200
commit439cdf1e2475d2f6622c151419f90c7da6de1434 (patch)
treec7e0fac0bef7831d7603fd95e8ff30cc805843da /login-utils/last.c
parentmisc-utils: verify writing to streams was successful (diff)
downloadkernel-qcow2-util-linux-439cdf1e2475d2f6622c151419f90c7da6de1434.tar.gz
kernel-qcow2-util-linux-439cdf1e2475d2f6622c151419f90c7da6de1434.tar.xz
kernel-qcow2-util-linux-439cdf1e2475d2f6622c151419f90c7da6de1434.zip
login-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r--login-utils/last.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/login-utils/last.c b/login-utils/last.c
index 417314ee5..34558bb9d 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -56,6 +56,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include "closestream.h"
#include "pathnames.h"
#include "nls.h"
#include "xalloc.h"
@@ -121,6 +122,7 @@ main(int argc, char **argv) {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ atexit(close_stdout);
while ((ch = getopt(argc, argv, "0123456789yli:f:h:t:")) != -1)
switch((char)ch) {