projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ccde3fb
)
utrace: Report ptrace errors
author
Michal Sojka
<sojkam1@fel.cvut.cz>
Tue, 12 Sep 2017 11:12:46 +0000
(13:12 +0200)
committer
John Crispin
<john@phrozen.org>
Thu, 28 Sep 2017 06:26:56 +0000
(08:26 +0200)
trace/trace.c
patch
|
blob
|
history
diff --git
a/trace/trace.c
b/trace/trace.c
index 5189cfb11290baa18c3897a06ee51223ae2676f7..7fe55990e3ca53d00d347337ea6025632ee798ca 100644
(file)
--- a/
trace/trace.c
+++ b/
trace/trace.c
@@
-25,6
+25,7
@@
#include <errno.h>
#include <string.h>
#include <syslog.h>
#include <errno.h>
#include <string.h>
#include <syslog.h>
+#include <err.h>
#ifndef PTRACE_EVENT_STOP
/* PTRACE_EVENT_STOP is defined in linux/ptrace.h, but this header
#ifndef PTRACE_EVENT_STOP
/* PTRACE_EVENT_STOP is defined in linux/ptrace.h, but this header
@@
-360,8
+361,10
@@
int main(int argc, char **argv, char **envp)
ptrace_restart = PTRACE_CONT;
break;
}
ptrace_restart = PTRACE_CONT;
break;
}
- ptrace(PTRACE_SEIZE, child, 0, ptrace_options);
- ptrace(ptrace_restart, child, 0, SIGCONT);
+ if (ptrace(PTRACE_SEIZE, child, 0, ptrace_options) == -1)
+ err(1, "PTRACE_SEIZE");
+ if (ptrace(ptrace_restart, child, 0, SIGCONT) == -1)
+ err(1, "ptrace restart");
uloop_init();
tracer.proc.pid = child;
uloop_init();
tracer.proc.pid = child;