Browse Source

remove incorrect fflush from assert failure handler

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.
Rich Felker 4 years ago
parent
commit
47baa0301f
1 changed files with 0 additions and 1 deletions
  1. 0 1
      src/exit/assert.c

+ 0 - 1
src/exit/assert.c

@@ -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();
 }