summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2005-07-20 16:16:05 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2005-07-20 16:16:05 +0000
commitd52f40f208fcf36757566ab02fc60dda122ad376 (patch)
tree138109178407548b1cef171becef61a400db0090
parent25f4cde0b3ca57cf0b3f23737c63944a030035f7 (diff)
EFAULT from PT_IO is a good error value too.
-rw-r--r--regress/sys/kern/ptrace/ptrace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/regress/sys/kern/ptrace/ptrace.c b/regress/sys/kern/ptrace/ptrace.c
index 51db6f4de18..bb07185d1d2 100644
--- a/regress/sys/kern/ptrace/ptrace.c
+++ b/regress/sys/kern/ptrace/ptrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ptrace.c,v 1.1 2005/07/20 15:31:43 art Exp $ */
+/* $OpenBSD: ptrace.c,v 1.2 2005/07/20 16:16:04 art Exp $ */
/*
* Copyright (c) 2005 Artur Grabowski <art@openbsd.org>
*
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
+#include <errno.h>
static void
usage(void)
@@ -129,7 +130,10 @@ main(int argc, char **argv)
if (ptrace(PT_IO, pid, (caddr_t)&piod, 0) == -1) {
warn("ptrace(PT_IO)");
- ret = -1;
+ if (errno == EFAULT)
+ ret = 1;
+ else
+ ret = -1;
goto out;
}