summaryrefslogtreecommitdiff
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorThomas Moestl <tmm@FreeBSD.org>2002-07-12 16:48:05 +0000
committerThomas Moestl <tmm@FreeBSD.org>2002-07-12 16:48:05 +0000
commit5c85966098d95e9682ba3c2f5364448e4ce0b032 (patch)
tree17dc8bc83c42f3201cc344852ff717bfe5f16afd /sys/kern/sys_process.c
parenta935ed4fae4bf79d943dcb54a7041e2ba03a415e (diff)
Notes
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index ab6f1e88326c..f4464063d56e 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -334,7 +334,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
} r;
struct proc *curp, *p, *pp;
struct thread *td2;
- int error, write;
+ int error, write, tmp;
int proctree_locked = 0;
curp = td->td_proc;
@@ -586,9 +586,9 @@ ptrace(struct thread *td, struct ptrace_args *uap)
case PT_READ_I:
case PT_READ_D:
PROC_UNLOCK(p);
+ tmp = 0;
/* write = 0 set above */
- iov.iov_base = write ? (caddr_t)&uap->data :
- (caddr_t)td->td_retval;
+ iov.iov_base = write ? (caddr_t)&uap->data : (caddr_t)&tmp;
iov.iov_len = sizeof(int);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
@@ -611,6 +611,8 @@ ptrace(struct thread *td, struct ptrace_args *uap)
if (error == 0 || error == ENOSPC || error == EPERM)
error = EINVAL; /* EOF */
}
+ if (!write)
+ td->td_retval[0] = tmp;
return (error);
case PT_IO: