diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-17 17:40:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-17 17:40:54 +0000 |
commit | 6b89ef53428719a187938e63ddaa6dd2eec268ec (patch) | |
tree | 59679c525890dce2eb875de57345f5d9526385ea /libexec/talkd/announce.c | |
parent | f8ffcc0023521d2938d013a064aafa8b97fdc6c4 (diff) |
do not mix concepts of gettimeofday(), tv_sec, and localtime() in a
useless fashion.
Diffstat (limited to 'libexec/talkd/announce.c')
-rw-r--r-- | libexec/talkd/announce.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libexec/talkd/announce.c b/libexec/talkd/announce.c index f29a19627c1..1ba6286d536 100644 --- a/libexec/talkd/announce.c +++ b/libexec/talkd/announce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: announce.c,v 1.21 2009/10/27 23:59:31 deraadt Exp $ */ +/* $OpenBSD: announce.c,v 1.22 2013/04/17 17:40:53 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -91,9 +91,7 @@ announce(CTL_MSG *request, char *remote_machine) static void print_mesg(FILE *tf, CTL_MSG *request, char *remote_machine) { - struct timeval clock; time_t clocktime; - struct timezone zone; struct tm *localclock; char line_buf[N_LINES][N_CHARS]; int sizes[N_LINES]; @@ -103,8 +101,7 @@ print_mesg(FILE *tf, CTL_MSG *request, char *remote_machine) i = 0; max_size = 0; - gettimeofday(&clock, &zone); - clocktime = clock.tv_sec; + time(&clocktime); localclock = localtime(&clocktime); (void)snprintf(line_buf[i], N_CHARS, " "); sizes[i] = strlen(line_buf[i]); |