From 68d46317f92e6cff6961f4c7bd45cef663487199 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 6 Apr 2022 10:17:15 -0400 Subject: [PATCH] Fix: remove non-async-signal-safe fflush from ERR() Commit ff1fedb9f2e8 ("usterr: make error reporting functions signal safe") changed the logging printout mechanism to use patient_write() to a file descriptor to ensure signal-safety of the ERR() logging mechanism. However, the fflush(stderr) was left in place, although it was useless. Unfortunately, fflush() is not async-signal-safe. Fix this by removing this fflush() call. Signed-off-by: Mathieu Desnoyers Change-Id: I13754acd914c4a9f71014a1e332c3fb25197a669 --- src/common/logging.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/logging.h b/src/common/logging.h index c98644d8..e8762c69 100644 --- a/src/common/logging.h +++ b/src/common/logging.h @@ -126,7 +126,6 @@ do { \ ____buf[sizeof(____buf) - 1] = 0; \ ust_patient_write(STDERR_FILENO, ____buf, strlen(____buf)); \ errno = ____saved_errno; /* signal-safety */ \ - fflush(stderr); \ } \ } while (0) -- 2.34.1