summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-08-29 22:53:03 +0000
committerhubertf <hubertf@NetBSD.org>1998-08-29 22:53:03 +0000
commitc4c1ed4f214d1b50a09d0c42fa9c741ac18fb482 (patch)
tree0beadaa121ac2fada96d7d77d0d5e78729ef6fff
parentb5ca0e4da5f9e9439390a53e0d218c013a0b420e (diff)
downloadbsdgames-darwin-c4c1ed4f214d1b50a09d0c42fa9c741ac18fb482.tar.gz
bsdgames-darwin-c4c1ed4f214d1b50a09d0c42fa9c741ac18fb482.tar.zst
bsdgames-darwin-c4c1ed4f214d1b50a09d0c42fa9c741ac18fb482.zip
Use symbolic names for signals(!), open(2)-constants, ...
Fix applied as per PR 6058 by Joseph Myers <jsm28@cam.ac.uk>
-rw-r--r--backgammon/backgammon/main.c8
-rw-r--r--backgammon/common_source/save.c12
-rw-r--r--backgammon/teachgammon/teach.c6
3 files changed, 13 insertions, 13 deletions
diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c
index 5cdb95e5..207c3c1b 100644
--- a/backgammon/backgammon/main.c
+++ b/backgammon/backgammon/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 1998/03/29 04:46:40 mrg Exp $ */
+/* $NetBSD: main.c,v 1.7 1998/08/29 22:53:03 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.6 1998/03/29 04:46:40 mrg Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 1998/08/29 22:53:03 hubertf Exp $");
#endif
#endif /* not lint */
@@ -112,7 +112,7 @@ main(argc, argv)
/* initialization */
bflag = 2; /* default no board */
- signal(2, getout); /* trap interrupts */
+ signal(SIGINT, getout); /* trap interrupts */
if (tcgetattr(0, &old) == -1) /* get old tty mode */
errexit("backgammon(gtty)");
noech = old;
@@ -212,7 +212,7 @@ main(argc, argv)
else
writec('\n');
writel("Password:");
- signal(14, getout);
+ signal(SIGALRM, getout);
cflag = 1;
alarm(10);
for (i = 0; i < 10; i++) {
diff --git a/backgammon/common_source/save.c b/backgammon/common_source/save.c
index 5fd48f46..8faec03d 100644
--- a/backgammon/common_source/save.c
+++ b/backgammon/common_source/save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.5 1997/10/10 08:59:48 lukem Exp $ */
+/* $NetBSD: save.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,13 +38,13 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.5 1997/10/10 08:59:48 lukem Exp $");
+__RCSID("$NetBSD: save.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $");
#endif
#endif /* not lint */
-#include "back.h"
+#include <errno.h>
-extern int errno;
+#include "back.h"
static char confirm[] = "Are you sure you want to leave now?";
static char prompt[] = "Enter a file name: ";
@@ -94,7 +94,7 @@ save(n)
writec(*fs++);
}
*fs = '\0';
- if ((fdesc = open(fname, 2)) == -1 && errno == 2) {
+ if ((fdesc = open(fname, O_RDWR)) == -1 && errno == ENOENT) {
if ((fdesc = creat(fname, 0700)) != -1)
break;
}
@@ -154,7 +154,7 @@ recover(s)
{
int fdesc;
- if ((fdesc = open(s, 0)) == -1)
+ if ((fdesc = open(s, O_RDONLY)) == -1)
norec(s);
read(fdesc, board, sizeof board);
read(fdesc, off, sizeof off);
diff --git a/backgammon/teachgammon/teach.c b/backgammon/teachgammon/teach.c
index f473d044..8a0089a7 100644
--- a/backgammon/teachgammon/teach.c
+++ b/backgammon/teachgammon/teach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.5 1997/10/10 08:59:52 lukem Exp $ */
+/* $NetBSD: teach.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.5 1997/10/10 08:59:52 lukem Exp $");
+__RCSID("$NetBSD: teach.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $");
#endif
#endif /* not lint */
@@ -72,7 +72,7 @@ main(argc, argv)
{
int i;
- signal(2, getout);
+ signal(SIGINT, getout);
if (tcgetattr(0, &old) == -1) /* get old tty mode */
errexit("teachgammon(gtty)");
noech = old;