]> granicus.if.org Git - strace/commitdiff
Ignore fflush(3) return value
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 17 Sep 2012 22:40:12 +0000 (22:40 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 28 Sep 2012 01:18:43 +0000 (01:18 +0000)
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.

syscall.c

index cda017c584c2b251ad486078b7fd2c6efb1fdee1..c4c5e86830616d44beb63748a65f562878faccb7 100644 (file)
--- 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. */