From: Mathieu Desnoyers Date: Wed, 6 Apr 2022 14:17:15 +0000 (-0400) Subject: Fix: remove non-async-signal-safe fflush from ERR() X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=68d46317f92e6cff6961f4c7bd45cef663487199;p=lttng-ust.git 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 --- 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)