#include <stdbool.h>
#include <stdio.h>
-static UNUSED void
-FatalErrnoError(bool condition, char const msg[]) /*@*/
+static inline ALWAYSINLINE NORETURN void
+FatalErrnoErrorFail(char const msg[])
{
extern int wrapper_exit_code;
- if (!condition) return;
+#ifdef ENSC_WRAPPERS_PREFIX
+ {
+ int old_errno = errno;
+ WRITE_MSG(2, ENSC_WRAPPERS_PREFIX);
+ errno = old_errno;
+ }
+#endif
perror(msg);
-
+
exit(wrapper_exit_code);
}
+
+static UNUSED void
+FatalErrnoError(bool condition, char const msg[]) /*@*/
+{
+ if (__builtin_expect(!condition,true)) return;
+ FatalErrnoErrorFail(msg);
+}