summaryrefslogtreecommitdiffstats
path: root/battlestar
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-14 18:08:46 +0000
committerjsm <jsm@NetBSD.org>1999-09-14 18:08:46 +0000
commit3bd46c45bcef32e5f54d70344e4717e8d3b641af (patch)
tree900dd1b7fc5083708e9949a4e8ebafba4cfc2f89 /battlestar
parentd2e32fbfdf35f7c638077852aa6fd4f772e565c8 (diff)
downloadbsdgames-darwin-3bd46c45bcef32e5f54d70344e4717e8d3b641af.tar.gz
bsdgames-darwin-3bd46c45bcef32e5f54d70344e4717e8d3b641af.tar.zst
bsdgames-darwin-3bd46c45bcef32e5f54d70344e4717e8d3b641af.zip
Use time() instead of gettimeofday().
Diffstat (limited to 'battlestar')
-rw-r--r--battlestar/com6.c12
-rw-r--r--battlestar/extern.h5
2 files changed, 7 insertions, 10 deletions
diff --git a/battlestar/com6.c b/battlestar/com6.c
index 95f18d71..027249d2 100644
--- a/battlestar/com6.c
+++ b/battlestar/com6.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com6.c,v 1.14 1999/09/13 17:18:56 jsm Exp $ */
+/* $NetBSD: com6.c,v 1.15 1999/09/14 18:08:46 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: com6.c,v 1.14 1999/09/13 17:18:56 jsm Exp $");
+__RCSID("$NetBSD: com6.c,v 1.15 1999/09/14 18:08:46 jsm Exp $");
#endif
#endif /* not lint */
@@ -121,17 +121,15 @@ void
post(ch)
char ch;
{
- struct timeval tv;
- time_t tvsec;
+ time_t tv;
char *date;
sigset_t sigset, osigset;
sigemptyset(&sigset);
sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset);
- gettimeofday(&tv, (struct timezone *) 0); /* can't call time */
- tvsec = (time_t) tv.tv_sec;
- date = ctime(&tvsec);
+ tv = time(NULL);
+ date = ctime(&tv);
date[24] = '\0';
if (score_fp != NULL) {
fprintf(score_fp, "%s %8s %c%20s", date, username, ch, rate());
diff --git a/battlestar/extern.h b/battlestar/extern.h
index f431dd46..0b48dafc 100644
--- a/battlestar/extern.h
+++ b/battlestar/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.13 1999/09/13 17:18:57 jsm Exp $ */
+/* $NetBSD: extern.h,v 1.14 1999/09/14 18:08:46 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,8 +35,6 @@
* @(#)externs.h 8.1 (Berkeley) 5/31/93
*/
-#include <sys/time.h>
-
#include <ctype.h>
#include <err.h>
#include <pwd.h>
@@ -44,6 +42,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#define BITS (8 * sizeof (int))