diff --git a/usr.sbin/lastlogin/lastlogin.c b/usr.sbin/lastlogin/lastlogin.c --- a/usr.sbin/lastlogin/lastlogin.c +++ b/usr.sbin/lastlogin/lastlogin.c @@ -39,7 +39,7 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $"); #endif -#include + #include #include #include @@ -84,7 +84,7 @@ argc = xo_parse_args(argc, argv); if (argc < 0) - exit(1); + exit(EXIT_FAILURE); while ((ch = getopt(argc, argv, "f:rt")) != -1) { switch (ch) { @@ -145,9 +145,10 @@ xo_close_list("lastlogin"); xo_close_container("lastlogin-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); - exit(0); + exit(EXIT_SUCCESS); } /* Duplicate the output of last(1) */ @@ -168,6 +169,7 @@ usage(void) { xo_error("usage: lastlogin [-f file] [-rt] [user ...]\n"); - xo_finish(); - exit(1); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); + exit(EXIT_FAILURE); }