remove incorrect fflush from assert failure handler
authorRich Felker <dalias@aerifal.cx>
Wed, 14 Oct 2020 14:55:55 +0000 (10:55 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 15 Oct 2020 00:27:12 +0000 (20:27 -0400)
assert is not specified to flush open stdio streams, and doing so can
block indefinitely waiting for a lock already held or an output
operation to a file that can't accept more output until an
unsatisfiable condition is met.

src/exit/assert.c

index 49b0dc3..94edd82 100644 (file)
@@ -4,6 +4,5 @@
 _Noreturn void __assert_fail(const char *expr, const char *file, int line, const char *func)
 {
        fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line);
-       fflush(NULL);
        abort();
 }