summaryrefslogtreecommitdiff
path: root/usr.bin/ktrace/ktrace.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-11-14 20:00:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-11-14 20:00:49 +0000
commit542229f4f2caba984db2eef8cc351882ca9080bc (patch)
tree2f65bf962bb53e2a8db2cd84443c082e227d16b8 /usr.bin/ktrace/ktrace.c
parent863034e180bbcbfe43fb8040adaaea4f248f6d23 (diff)
get rid of signal race
Diffstat (limited to 'usr.bin/ktrace/ktrace.c')
-rw-r--r--usr.bin/ktrace/ktrace.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index 349e26cae84..c900f02f2fe 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrace.c,v 1.11 2001/08/18 00:48:57 espie Exp $ */
+/* $OpenBSD: ktrace.c,v 1.12 2001/11/14 20:00:48 deraadt Exp $ */
/* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: ktrace.c,v 1.11 2001/08/18 00:48:57 espie Exp $";
+static char *rcsid = "$OpenBSD: ktrace.c,v 1.12 2001/11/14 20:00:48 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -202,7 +202,10 @@ static void
no_ktrace(sig)
int sig;
{
- (void)fprintf(stderr,
+ char buf[8192];
+
+ snprintf(buf, sizeof(buf),
"error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n");
- exit(1);
+ write(STDERR_FILENO, buf, strlen(buf));
+ _exit(1);
}