Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/battlestar Use time() instead of gettimeofday().
details: https://anonhg.NetBSD.org/src/rev/a0733b1e7251
branches: trunk
changeset: 476358:a0733b1e7251
user: jsm <jsm%NetBSD.org@localhost>
date: Tue Sep 14 18:08:46 1999 +0000
description:
Use time() instead of gettimeofday().
diffstat:
games/battlestar/com6.c | 12 +++++-------
games/battlestar/extern.h | 5 ++---
2 files changed, 7 insertions(+), 10 deletions(-)
diffs (65 lines):
diff -r c579a0c239eb -r a0733b1e7251 games/battlestar/com6.c
--- a/games/battlestar/com6.c Tue Sep 14 18:07:21 1999 +0000
+++ b/games/battlestar/com6.c Tue Sep 14 18:08:46 1999 +0000
@@ -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 @@
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 -r c579a0c239eb -r a0733b1e7251 games/battlestar/extern.h
--- a/games/battlestar/extern.h Tue Sep 14 18:07:21 1999 +0000
+++ b/games/battlestar/extern.h Tue Sep 14 18:08:46 1999 +0000
@@ -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))
Home |
Main Index |
Thread Index |
Old Index