diff options
author | Miles Bader <miles@gnu.org> | 1996-05-15 02:13:20 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-05-15 02:13:20 +0000 |
commit | 31dceaf6397f51f706a411824ef1a9af0040f29b (patch) | |
tree | 1c1588c960805ba505d7af2f0dcc07311fd2e792 | |
parent | 98b13dc28099461a9c72ceb5bcaf9a4ca43fe9b3 (diff) |
(dog): Use error to print messages. Use pretty time fmting.
-rw-r--r-- | utils/login.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/login.c b/utils/login.c index 5856d79c..2e91e27c 100644 --- a/utils/login.c +++ b/utils/login.c @@ -41,6 +41,7 @@ #include <envz.h> #include <idvec.h> #include <error.h> +#include <timefmt.h> #include <hurd/lookup.h> extern error_t @@ -335,13 +336,19 @@ dog (time_t timeout, pid_t pid) exit (0); /* Give up, luser wins. */ /* None are owned. Kill session after emitting cryptic, yet stupid, message. */ - fprintf (stderr, "Beware of dog.\n"); + error (0, 0, "Beware of dog."); } else if (err) exit (1); /* Impossible error.... XXX */ else /* Give normal you-forgot-to-login message. */ - fprintf (stderr, "Login timed out after %ld seconds.\n", timeout); + { + char interval[10]; /* Be gratuitously pretty. */ + struct timeval tv = { timeout, 0 }; + + fmt_named_interval (&tv, 0, interval, sizeof interval); + error (0, 0, "Timed out after %s.", interval); + } /* Kill login session, trying to be nice about it. */ kill_login (proc_server, pid, SIGHUP); |