From 9330559d24ff15b782c266febc32342dca8698f4 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 29 Apr 2022 13:34:39 +0200 Subject: [PATCH] Defined and use _write --- winpr/include/winpr/crt.h | 6 ++++++ winpr/libwinpr/utils/debug.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winpr/include/winpr/crt.h b/winpr/include/winpr/crt.h index 76237deb2..3603bf9a6 100644 --- a/winpr/include/winpr/crt.h +++ b/winpr/include/winpr/crt.h @@ -31,6 +31,12 @@ #ifndef _WIN32 +#include + +#ifndef _write +#define _write write +#endif + #ifndef _strtoui64 #define _strtoui64 strtoull #endif diff --git a/winpr/libwinpr/utils/debug.c b/winpr/libwinpr/utils/debug.c index 220ba57d1..d65e3c86a 100644 --- a/winpr/libwinpr/utils/debug.c +++ b/winpr/libwinpr/utils/debug.c @@ -22,6 +22,8 @@ #include #include + +#include #include #if defined(HAVE_EXECINFO_H) @@ -161,7 +163,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd) return; for (i = 0; i < used; i++) - write(fd, lines[i], (unsigned)strnlen(lines[i], UINT32_MAX)); + _write(fd, lines[i], (unsigned)strnlen(lines[i], UINT32_MAX)); } #else LOGF(support_msg);