move log file to /var/games
[unix-history] / usr / src / games / battlestar / com6.c
index 50c00bc..e7a25de 100644 (file)
@@ -1,8 +1,26 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)com6.c     1.1 %G%";
-#endif
+static char sccsid[] = "@(#)com6.c     5.3 (Berkeley) %G%";
+#endif /* not lint */
 
 #include "externs.h"
 
 #include "externs.h"
+#include "pathnames.h"
 
 launch()
 {
 
 launch()
 {
@@ -62,11 +80,12 @@ char ch;
        FILE *fp;
        struct timeval tv;
        char *date;
        FILE *fp;
        struct timeval tv;
        char *date;
+       int s = sigblock(sigmask(SIGINT));
 
        gettimeofday(&tv, (struct timezone *)0);        /* can't call time */
        date = ctime(&tv.tv_sec);
        date[24] = '\0';
 
        gettimeofday(&tv, (struct timezone *)0);        /* can't call time */
        date = ctime(&tv.tv_sec);
        date[24] = '\0';
-       if (fp = fopen(logfile,"a")) {
+       if (fp = fopen(_PATH_SCORE,"a")) {
                fprintf(fp, "%s  %8s  %c%20s", date, uname, ch, rate());
                if (wiz)
                        fprintf(fp, "   wizard\n");
                fprintf(fp, "%s  %8s  %c%20s", date, uname, ch, rate());
                if (wiz)
                        fprintf(fp, "   wizard\n");
@@ -75,7 +94,8 @@ char ch;
                else
                        fprintf(fp, "\n");
        } else
                else
                        fprintf(fp, "\n");
        } else
-               perror(logfile);
+               perror(_PATH_SCORE);
+       sigsetmask(s);
 }
 
 char *
 }
 
 char *
@@ -118,7 +138,7 @@ rate()
 drive()
 {
        if (testbit(location[position].objects,CAR)){
 drive()
 {
        if (testbit(location[position].objects,CAR)){
-               puts("You hop in the car and turn the key.  There is a perceptible grating noise");
+               puts("You hop in the car and turn the key.  There is a perceptible grating noise,");
                puts("and an explosion knocks you unconscious...");
                clearbit(location[position].objects,CAR);
                setbit(location[position].objects,CRASH);
                puts("and an explosion knocks you unconscious...");
                clearbit(location[position].objects,CAR);
                setbit(location[position].objects,CRASH);