projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71f7a3c
)
fix ptrace (maybe)
author
Rich Felker
<dalias@aerifal.cx>
Fri, 16 Sep 2011 14:13:00 +0000
(10:13 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 16 Sep 2011 14:13:00 +0000
(10:13 -0400)
src/misc/ptrace.c
patch
|
blob
|
history
diff --git
a/src/misc/ptrace.c
b/src/misc/ptrace.c
index 1cc00167331c83639230cb6484e9dede5f299f41..f8540698b47277ecc3448fd9e98e8d1bd152f8bc 100644
(file)
--- a/
src/misc/ptrace.c
+++ b/
src/misc/ptrace.c
@@
-8,11
+8,18
@@
long ptrace(int req, ...)
va_list ap;
pid_t pid;
void *addr, *data, *addr2;
+ long ret, result;
+
va_start(ap, req);
pid = va_arg(ap, pid_t);
addr = va_arg(ap, void *);
data = va_arg(ap, void *);
addr2 = va_arg(ap, void *);
va_end(ap);
- return syscall(SYS_ptrace, req, pid, addr, data, addr2);
+
+ if (req<4U) data = &result;
+ ret = syscall(SYS_ptrace, req, pid, addr, data, addr2);
+
+ if (ret<0 || req>=4U) return ret;
+ return result;
}