summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2018-02-07 02:16:50 +0100
committerDmitry V. Levin <ldv@altlinux.org>2018-02-10 01:33:49 +0000
commita59e41e1215b5565af5697eb79f877c63be442c2 (patch)
treef63523f11f93db028350b9158c3bbf56db3f2541 /syscall.c
parent34c644b48552876d69ac9368a8bd444a9335d259 (diff)
downloadstrace-a59e41e1215b5565af5697eb79f877c63be442c2.tar.gz
syscall.c: warn if tampering failed
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/syscall.c b/syscall.c
index 79e998612..4ef34f4b5 100644
--- a/syscall.c
+++ b/syscall.c
@@ -551,6 +551,14 @@ tamper_with_syscall_entering(struct tcb *tcp, unsigned int *signo)
static long
tamper_with_syscall_exiting(struct tcb *tcp)
{
+ if (!syserror(tcp)) {
+ error_msg("Failed to tamper with process %d: got no error "
+ "(return value %#" PRI_klx ")",
+ tcp->pid, tcp->u_rval);
+
+ return 1;
+ }
+
struct inject_opts *opts = tcb_inject_opts(tcp);
if (!opts)
@@ -731,7 +739,7 @@ syscall_exiting_decode(struct tcb *tcp, struct timeval *ptv)
int
syscall_exiting_trace(struct tcb *tcp, struct timeval tv, int res)
{
- if (syserror(tcp) && syscall_tampered(tcp))
+ if (syscall_tampered(tcp))
tamper_with_syscall_exiting(tcp);
if (cflag) {