summaryrefslogtreecommitdiffstats
path: root/adventure/main.c
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>1996-05-21 10:48:07 +0000
committermrg <mrg@NetBSD.org>1996-05-21 10:48:07 +0000
commit4b62a0368fd5c80f3c11847e1611718031a54467 (patch)
tree4c905bf36634cc825c0bdf30da52828b30d3088f /adventure/main.c
parent711ef65c66491e5359a0d14ba54d977ebef5dc3f (diff)
downloadbsdgames-darwin-4b62a0368fd5c80f3c11847e1611718031a54467.tar.gz
bsdgames-darwin-4b62a0368fd5c80f3c11847e1611718031a54467.tar.zst
bsdgames-darwin-4b62a0368fd5c80f3c11847e1611718031a54467.zip
give up setuid-ness. we don't need it. while i'm here, include
<sys/signal.h> and use SIGINT rather than 2.
Diffstat (limited to 'adventure/main.c')
-rw-r--r--adventure/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/adventure/main.c b/adventure/main.c
index 95f62668..4fdfbcc8 100644
--- a/adventure/main.c
+++ b/adventure/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.3 1996/02/06 22:47:06 jtc Exp $ */
+/* $NetBSD: main.c,v 1.4 1996/05/21 10:48:07 mrg Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -48,17 +48,17 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.3 1996/02/06 22:47:06 jtc Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.4 1996/05/21 10:48:07 mrg Exp $";
#endif
#endif /* not lint */
/* Re-coding of advent in C: main program */
#include <sys/file.h>
+#include <sys/signal.h>
#include <stdio.h>
#include "hdr.h"
-
main(argc,argv)
int argc;
char **argv;
@@ -68,8 +68,12 @@ char **argv;
struct text *kk;
extern trapdel();
+ /* adventure doesn't need setuid-ness, so, just get rid of it */
+ if (setuid(getuid()) < 0)
+ perror("setuid");
+
init(); /* Initialize everything */
- signal(2,trapdel);
+ signal(SIGINT,trapdel);
if (argc > 1) /* Restore file specified */
{ /* Restart is label 8305 (Fortran) */