Ignore fflush(3) return value

strace used to honor fflush(3) return value in trace_syscall_entering
which resulted to tracees not being PTRACE_SYSCALL'ed which in turn
caused nasty hangups like this one:

$ strace -o'|:' pwd
|:: Broken pipe

There is little strace can do in case of fflush(3) returning EOF, and
hangup is certainly not the best solution for the issue.

* syscall.c (trace_syscall_entering): Ignore fflush(3) return value.
This commit is contained in:
Дмитрий Левин 2012-09-17 22:40:12 +00:00
parent 9a71bcdab2
commit b742d8c1b8

View File

@ -1581,8 +1581,7 @@ trace_syscall_entering(struct tcb *tcp)
else
res = (*sysent[tcp->scno].sys_func)(tcp);
if (fflush(tcp->outf) == EOF)
return -1;
fflush(tcp->outf);
ret:
tcp->flags |= TCB_INSYSCALL;
/* Measure the entrance time as late as possible to avoid errors. */