diff options
author | Eugene Syromyatnikov <evgsyr@gmail.com> | 2018-02-07 02:16:50 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2018-02-10 01:33:49 +0000 |
commit | a59e41e1215b5565af5697eb79f877c63be442c2 (patch) | |
tree | f63523f11f93db028350b9158c3bbf56db3f2541 /syscall.c | |
parent | 34c644b48552876d69ac9368a8bd444a9335d259 (diff) | |
download | strace-a59e41e1215b5565af5697eb79f877c63be442c2.tar.gz |
syscall.c: warn if tampering failed
Diffstat (limited to 'syscall.c')
-rw-r--r-- | syscall.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) { |