X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/4fe92d1fcdbb2fc53d5d338814045f676c06cc4a..4c2fca22580ba0ae4ec901cca158c5e228494265:/battlestar/command6.c diff --git a/battlestar/command6.c b/battlestar/command6.c index c877c1f0..0c6c8641 100644 --- a/battlestar/command6.c +++ b/battlestar/command6.c @@ -1,4 +1,4 @@ -/* $NetBSD: command6.c,v 1.3 2005/07/01 06:04:54 jmc Exp $ */ +/* $NetBSD: command6.c,v 1.8 2010/04/24 00:38:30 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,13 +34,15 @@ #if 0 static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: command6.c,v 1.3 2005/07/01 06:04:54 jmc Exp $"); +__RCSID("$NetBSD: command6.c,v 1.8 2010/04/24 00:38:30 dholland Exp $"); #endif #endif /* not lint */ #include "extern.h" #include "pathnames.h" +static void post(int); + int launch(void) { @@ -89,7 +91,7 @@ die(void) } void -diesig(int dummy __attribute__((__unused__))) +diesig(int dummy __unused) { die(); } @@ -114,21 +116,18 @@ open_score_file(void) exit(1); } -void +static void post(int ch) { time_t tv; - char *date; sigset_t isigset, osigset; sigemptyset(&isigset); sigaddset(&isigset, SIGINT); sigprocmask(SIG_BLOCK, &isigset, &osigset); tv = time(NULL); - date = ctime(&tv); - date[24] = '\0'; if (score_fp != NULL) { - fprintf(score_fp, "%s %8s %c%20s", date, username, + fprintf(score_fp, "%24.24s %8s %c%20s", ctime(&tv), username, ch, rate()); if (wiz) fprintf(score_fp, " wizard\n"); @@ -138,6 +137,7 @@ post(int ch) else fprintf(score_fp, "\n"); } + fflush(score_fp); sigprocmask(SIG_SETMASK, &osigset, (sigset_t *) 0); }