Message ID | 20180730073110.28309-1-sojkam1@fel.cvut.cz |
---|---|
State | Accepted |
Delegated to: | John Crispin |
Headers | show |
Series | [OpenWrt-Devel,procd,1/2] trace: Use properly sized type for PTRACE_GETEVENTMSG | expand |
diff --git a/trace/trace.c b/trace/trace.c index 27cf108..665c22e 100644 --- a/trace/trace.c +++ b/trace/trace.c @@ -211,7 +211,9 @@ static void tracer_cb(struct uloop_process *c, int ret) (ret >> 8) == (SIGTRAP | (PTRACE_EVENT_CLONE << 8))) { struct tracee *child = calloc(1, sizeof(struct tracee)); - ptrace(PTRACE_GETEVENTMSG, c->pid, 0, &child->proc.pid); + unsigned long msg; + ptrace(PTRACE_GETEVENTMSG, c->pid, 0, &msg); + child->proc.pid = msg; child->proc.cb = tracer_cb; ptrace(ptrace_restart, child->proc.pid, 0, 0); uloop_process_add(&child->proc);