From: Dmitry V. Levin Date: Mon, 17 Sep 2012 22:40:12 +0000 (+0000) Subject: Ignore fflush(3) return value X-Git-Tag: v4.8~214 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b742d8c1b8001dd2b8784f5a123cc8eb08f679ca;p=strace 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. --- diff --git a/syscall.c b/syscall.c index cda017c5..c4c5e868 100644 --- a/syscall.c +++ b/syscall.c @@ -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. */