diff --git a/mongoose.c b/mongoose.c index 98ddb7f5..d5b1dd91 100644 --- a/mongoose.c +++ b/mongoose.c @@ -902,11 +902,7 @@ static bool p_remove(const char *path) { } static bool p_mkdir(const char *path) { -#if defined(__MINGW32__) || defined(__MINGW64__) - return mkdir(path) == 0; -#else return mkdir(path, 0775) == 0; -#endif } #else @@ -3511,7 +3507,7 @@ static bool mg_socketpair(SOCKET sp[2], union usa usa[2]) { } void mg_mgr_wakeup(struct mg_connection *c, const void *buf, size_t len) { - LOG(LL_INFO, ("skt: %p", c->pfn_data)); + if (buf == NULL || len == 0) buf = (void *) "", len = 1; send((SOCKET) (size_t) c->pfn_data, (const char *) buf, len, MSG_NONBLOCKING); } diff --git a/mongoose.h b/mongoose.h index af412d1b..37db09ea 100644 --- a/mongoose.h +++ b/mongoose.h @@ -353,6 +353,7 @@ struct timeval { #endif #include +#include #include #include #include @@ -408,6 +409,7 @@ typedef int socklen_t; #define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX) #define sleep(x) Sleep(x) +#define mkdir(a, b) _mkdir(a) #ifndef va_copy #ifdef __va_copy diff --git a/src/arch_win32.h b/src/arch_win32.h index 759a140f..b5ab24a3 100644 --- a/src/arch_win32.h +++ b/src/arch_win32.h @@ -15,6 +15,7 @@ #endif #include +#include #include #include #include @@ -70,6 +71,7 @@ typedef int socklen_t; #define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX) #define sleep(x) Sleep(x) +#define mkdir(a, b) _mkdir(a) #ifndef va_copy #ifdef __va_copy diff --git a/src/fs_posix.c b/src/fs_posix.c index 5eba96ad..68109819 100644 --- a/src/fs_posix.c +++ b/src/fs_posix.c @@ -199,11 +199,7 @@ static bool p_remove(const char *path) { } static bool p_mkdir(const char *path) { -#if defined(__MINGW32__) || defined(__MINGW64__) - return mkdir(path) == 0; -#else return mkdir(path, 0775) == 0; -#endif } #else diff --git a/src/sock.c b/src/sock.c index b9dca1b0..5639b882 100644 --- a/src/sock.c +++ b/src/sock.c @@ -445,7 +445,7 @@ static bool mg_socketpair(SOCKET sp[2], union usa usa[2]) { } void mg_mgr_wakeup(struct mg_connection *c, const void *buf, size_t len) { - LOG(LL_INFO, ("skt: %p", c->pfn_data)); + if (buf == NULL || len == 0) buf = (void *) "", len = 1; send((SOCKET) (size_t) c->pfn_data, (const char *) buf, len, MSG_NONBLOCKING); }