From 0655cbc3ed57488979ac66030248bbff8e9b8d3d Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 3 Jun 2024 17:14:03 +0300 Subject: [PATCH] reset errno even on systems using glibc apparently it is not just BSD and musl libc that do not reset errno (not anymore) Signed-off-by: Ivailo Monev --- src/core/kernel/qcore_unix_p.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/core/kernel/qcore_unix_p.h b/src/core/kernel/qcore_unix_p.h index 935273e50..929086798 100644 --- a/src/core/kernel/qcore_unix_p.h +++ b/src/core/kernel/qcore_unix_p.h @@ -54,15 +54,9 @@ var = cmd; \ } while (var == -1 && errno == EINTR) -// BSD and musl libc implementations do not reset errno and there is no -// reliable way to check if some functions (e.g. strtoll()) errored or returned -// a valid value if they do not reset errno -#ifdef __GLIBC__ -# define Q_RESET_ERRNO -#else -# define Q_RESET_ERRNO errno = 0; -#endif - +// there is no reliable way to check if some functions (e.g. strtoll()) errored +// or returned a valid value if errno is not reset +#define Q_RESET_ERRNO errno = 0; QT_BEGIN_NAMESPACE