move log file to /var/games
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 4 May 1990 01:44:54 +0000 (17:44 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 4 May 1990 01:44:54 +0000 (17:44 -0800)
SCCS-vsn: games/sail/lo_main.c 5.5
SCCS-vsn: games/sail/misc.c 5.4
SCCS-vsn: games/sail/machdep.h 5.4

usr/src/games/sail/lo_main.c
usr/src/games/sail/machdep.h
usr/src/games/sail/misc.c

index 3e7b38f..600a296 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lo_main.c  5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)lo_main.c  5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -27,6 +27,7 @@ static char sccsid[] = "@(#)lo_main.c 5.4 (Berkeley) %G%";
 #include <sys/types.h>
 #include <pwd.h>
 #include "externs.h"
 #include <sys/types.h>
 #include <pwd.h>
 #include "externs.h"
+#include "pathnames.h"
 
 char *title[] = {
        "Admiral", "Commodore", "Captain", "Captain",
 
 char *title[] = {
        "Admiral", "Commodore", "Captain", "Captain",
@@ -43,8 +44,8 @@ lo_main()
        struct logs log;
        struct ship *ship;
 
        struct logs log;
        struct ship *ship;
 
-       if ((fp = fopen(LOGFILE, "r")) == 0) {
-               perror(LOGFILE);
+       if ((fp = fopen(_PATH_LOGFILE, "r")) == 0) {
+               perror(_PATH_LOGFILE);
                exit(1);
        }
        switch (fread((char *)&people, sizeof people, 1, fp)) {
                exit(1);
        }
        switch (fread((char *)&people, sizeof people, 1, fp)) {
@@ -54,7 +55,7 @@ lo_main()
        case 1:
                break;
        default:
        case 1:
                break;
        default:
-               perror(LOGFILE);
+               perror(_PATH_LOGFILE);
                exit(1);
        }
        while (fread((char *)&log, sizeof log, 1, fp) == 1 &&
                exit(1);
        }
        while (fread((char *)&log, sizeof log, 1, fp) == 1 &&
index cb2a944..57d2091 100644 (file)
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)machdep.h   5.3 (Berkeley) %G%
+ *     @(#)machdep.h   5.4 (Berkeley) %G%
  */
 
  */
 
-#define LOGFILE "/usr/games/lib/saillog"       /* has to match the makefile */
-
 #define TIMEOUT 300                            /* Sync() timeout in seconds */
 
 /* for 4.2bsd machines */
 #define TIMEOUT 300                            /* Sync() timeout in seconds */
 
 /* for 4.2bsd machines */
index e7740d2..1f84724 100644 (file)
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "externs.h"
 #endif /* not lint */
 
 #include "externs.h"
+#include "pathnames.h"
 
 #define distance(x,y) (abs(x) >= abs(y) ? abs(x) + abs(y)/2 : abs(y) + abs(x)/2)
 
 
 #define distance(x,y) (abs(x) >= abs(y) ? abs(x) + abs(y)/2 : abs(y) + abs(x)/2)
 
@@ -176,7 +177,7 @@ register struct ship *s;
        float net;
        register struct logs *lp;
 
        float net;
        register struct logs *lp;
 
-       if ((fp = fopen(LOGFILE, "r+")) == NULL)
+       if ((fp = fopen(_PATH_LOGFILE, "r+")) == NULL)
                return;
 #ifdef LOCK_EX
        if (flock(fileno(fp), LOCK_EX) < 0)
                return;
 #ifdef LOCK_EX
        if (flock(fileno(fp), LOCK_EX) < 0)