]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/com6.c
Put prototypes in alphabetical order.
[bsdgames-darwin.git] / battlestar / com6.c
index 50939f8eaf4814aeacbb346f27c25e8285a11c77..027249d252ed72bb19292d0c69d09fcbd556e2c1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: com6.c,v 1.11 1999/07/21 03:56:53 hubertf 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.11 1999/07/21 03:56:53 hubertf Exp $");
+__RCSID("$NetBSD: com6.c,v 1.15 1999/09/14 18:08:46 jsm Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -92,7 +92,7 @@ die()
 
 void
 diesig(dummy)
-       int     dummy;
+       int     dummy __attribute__((__unused__));
 {
        die();
 }
@@ -113,26 +113,26 @@ open_score_file()
        score_fp = fopen(_PATH_SCORE, "a");
        if (score_fp == NULL)
                warn("open %s for append", _PATH_SCORE);
+       if (score_fp != NULL && fileno(score_fp) < 3)
+               exit(1);
 }
 
 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, uname, ch, rate());
+               fprintf(score_fp, "%s  %8s  %c%20s", date, username, ch, rate());
                if (wiz)
                        fprintf(score_fp, "   wizard\n");
                else