diff arogue5/main.c @ 145:aac28331e71d

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.
author John "Elwin" Edwards
date Wed, 20 May 2015 08:42:17 -0400
parents 7faf4568c295
children 56e748983fa8
line wrap: on
line diff
--- a/arogue5/main.c	Mon May 18 10:53:22 2015 -0400
+++ b/arogue5/main.c	Wed May 20 08:42:17 2015 -0400
@@ -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 @@
 };
 #define NFRUIT (sizeof(funfruit) / sizeof (char *))
 
-int scorefd = -1;
-FILE *logfile = NULL;
 void open_records(void);
 
 main(argc, argv, envp)
@@ -255,7 +252,7 @@
 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");