summaryrefslogtreecommitdiffstats
path: root/adventure
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-08-29 20:19:56 +0000
committerhubertf <hubertf@NetBSD.org>1998-08-29 20:19:56 +0000
commitc806d568b889a7e5ff59a7764dbd0c5a074e6491 (patch)
treef4d12fcc4e574c96db30e36d370fb10295094919 /adventure
parentaef282629e988d9cb50311fe149d660dfb95f863 (diff)
downloadbsdgames-darwin-c806d568b889a7e5ff59a7764dbd0c5a074e6491.tar.gz
bsdgames-darwin-c806d568b889a7e5ff59a7764dbd0c5a074e6491.tar.zst
bsdgames-darwin-c806d568b889a7e5ff59a7764dbd0c5a074e6491.zip
Improved signal handling as per PR 6051 by
Joseph Myers <jsm@octomino.demon.co.uk>
Diffstat (limited to 'adventure')
-rw-r--r--adventure/hdr.h6
-rw-r--r--adventure/init.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/adventure/hdr.h b/adventure/hdr.h
index c1450c54..fa47b6de 100644
--- a/adventure/hdr.h
+++ b/adventure/hdr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hdr.h,v 1.4 1997/10/11 01:53:26 lukem Exp $ */
+/* $NetBSD: hdr.h,v 1.5 1998/08/29 20:19:56 hubertf Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -55,8 +55,10 @@
/* hdr.h: included by c advent files */
+#include <signal.h>
+
int datfd; /* message file descriptor */
-int delhit;
+volatile sig_atomic_t delhit;
int yea;
extern char data_file[]; /* Virtual data file */
diff --git a/adventure/init.c b/adventure/init.c
index 2f9c987e..14de1205 100644
--- a/adventure/init.c
+++ b/adventure/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.9 1998/08/24 22:07:37 hubertf Exp $ */
+/* $NetBSD: init.c,v 1.10 1998/08/29 20:19:56 hubertf Exp $ */
/*-
* Copyright (c) 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: init.c,v 1.9 1998/08/24 22:07:37 hubertf Exp $");
+__RCSID("$NetBSD: init.c,v 1.10 1998/08/29 20:19:56 hubertf Exp $");
#endif
#endif /* not lint */
@@ -219,7 +219,7 @@ void
trapdel(n) /* come here if he hits a del */
int n;
{
- delhit++; /* main checks, treats as QUIT */
+ delhit = 1; /* main checks, treats as QUIT */
signal(SIGINT, trapdel);/* catch subsequent DELs */
}