fix (hopefully) PTRACE_TRACEME (command 0) argument handling

This commit is contained in:
Rich Felker 2012-02-23 13:08:47 -05:00
parent 56ddcc7208
commit 00b883a955

View File

@ -17,9 +17,9 @@ long ptrace(int req, ...)
addr2 = va_arg(ap, void *);
va_end(ap);
if (req<4U) data = &result;
if (req-1U < 3) data = &result;
ret = syscall(SYS_ptrace, req, pid, addr, data, addr2);
if (ret<0 || req>=4U) return ret;
if (ret < 0 || req-1U >= 3) return ret;
return result;
}