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 <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-06-03 17:14:03 +03:00
parent 2c959dc7f3
commit 0655cbc3ed

View file

@ -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
// 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;
#endif
QT_BEGIN_NAMESPACE