Advanced Rogue family: fix the "score" option.

Changing the score file (when permitted) now works again, closing the
old score file and opening the new one.
This commit is contained in:
John "Elwin" Edwards 2015-05-20 08:42:17 -04:00
parent ea4244de91
commit e3620a3781
14 changed files with 105 additions and 14 deletions

View file

@ -16,7 +16,6 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <signal.h>
@ -43,8 +42,6 @@ static char *funfruit[] = {
};
#define NFRUIT (sizeof(funfruit) / sizeof (char *))
int scorefd = -1;
FILE *logfile = NULL;
void open_records(void);
main(argc, argv, envp)
@ -255,7 +252,7 @@ void
open_records(void)
{
if (scorefd == -1)
scorefd = open(score_file, O_RDWR | O_CREAT, 0666);
md_reopen_score();
#ifdef LOGFILE
if (logfile == NULL)
logfile = fopen(LOGFILE, "a");