summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-01-19 17:58:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-01-19 17:58:23 +0000
commit84feb65f67f9dfdd4c1946c042d07d10c65d4feb (patch)
tree74d99dd3e4d3b0bef09fc5651ccd2e0809ae452b /usr.bin
parent14ed877776dcefece53d3ac792a4ed18ba7dd630 (diff)
mark remaining signal races which are difficult to fix, and fix a few partially
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sort/sort.c6
-rw-r--r--usr.bin/sudo/visudo.c4
-rw-r--r--usr.bin/write/write.c17
-rw-r--r--usr.bin/yacc/main.c6
4 files changed, 18 insertions, 15 deletions
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index 0332a340b6b..7da39b63aeb 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.14 2000/06/30 16:00:23 millert Exp $ */
+/* $OpenBSD: sort.c,v 1.15 2001/01/19 17:58:18 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sort.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: sort.c,v 1.14 2000/06/30 16:00:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: sort.c,v 1.15 2001/01/19 17:58:18 deraadt Exp $";
#endif
#endif /* not lint */
@@ -314,7 +314,7 @@ onsig(s)
{
cleanup();
- exit(2); /* return 2 on error/interrupt */
+ _exit(2); /* return 2 on error/interrupt */
}
static void
diff --git a/usr.bin/sudo/visudo.c b/usr.bin/sudo/visudo.c
index ba8fa565174..293bcf8dd32 100644
--- a/usr.bin/sudo/visudo.c
+++ b/usr.bin/sudo/visudo.c
@@ -507,10 +507,10 @@ Exit(sig)
{
(void) unlink(stmp);
- if (sig > 0)
+ if (sig > 0) /* XXX signal race */
(void) fprintf(stderr, "%s exiting, caught signal %d.\n", Argv[0], sig);
- exit(-sig);
+ exit(-sig); /* XXX for signal case, should be _exit() */
}
static void
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index e5357d0deb6..60985c0ab29 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: write.c,v 1.10 1999/02/21 08:28:16 deraadt Exp $ */
+/* $OpenBSD: write.c,v 1.11 2001/01/19 17:58:21 deraadt Exp $ */
/* $NetBSD: write.c,v 1.5 1995/08/31 21:48:32 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)write.c 8.2 (Berkeley) 4/27/95";
#endif
-static char *rcsid = "$OpenBSD: write.c,v 1.10 1999/02/21 08:28:16 deraadt Exp $";
+static char *rcsid = "$OpenBSD: write.c,v 1.11 2001/01/19 17:58:21 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -66,7 +66,7 @@ static char *rcsid = "$OpenBSD: write.c,v 1.10 1999/02/21 08:28:16 deraadt Exp $
#include <err.h>
#include <vis.h>
-void done();
+void done __P((int sig));
void do_write __P((char *, char *, uid_t));
void wr_fputs __P((char *));
void search_utmp __P((char *, char *, char *, uid_t));
@@ -127,7 +127,7 @@ main(argc, argv)
(void)fprintf(stderr, "usage: write user [tty]\n");
exit(1);
}
- done();
+ done(0);
/* NOTREACHED */
}
@@ -285,10 +285,13 @@ do_write(tty, mytty, myuid)
* done - cleanup and exit
*/
void
-done()
+done(int sig)
{
- (void)printf("EOF\r\n");
- exit(0);
+ (void)printf("EOF\r\n"); /* XXX signal race */
+ if (sig)
+ _exit(0);
+ else
+ exit(0);
}
/*
diff --git a/usr.bin/yacc/main.c b/usr.bin/yacc/main.c
index 82e8840ba4b..7e80b1ef054 100644
--- a/usr.bin/yacc/main.c
+++ b/usr.bin/yacc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.10 1999/08/04 18:31:26 millert Exp $ */
+/* $OpenBSD: main.c,v 1.11 2001/01/19 17:58:22 deraadt Exp $ */
/* $NetBSD: main.c,v 1.5 1996/03/19 03:21:38 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 5/24/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.10 1999/08/04 18:31:26 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.11 2001/01/19 17:58:22 deraadt Exp $";
#endif
#endif /* not lint */
@@ -129,7 +129,7 @@ void
onintr(signo)
int signo;
{
- done(1);
+ done(1); /* XXX signal race */
}