1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

windows: only conceal mode_t on windows

This commit is contained in:
Andy Green 2021-06-20 06:00:48 +01:00
parent 0ba8df6eb4
commit 4c8195df22

View file

@ -209,8 +209,18 @@ int lws_open(const char *__file, int __oflag, ...)
|| ((__oflag & O_TMPFILE) == O_TMPFILE)
#endif
)
#if defined(WIN32)
/* last arg is really a mode_t. But windows... */
n = open(__file, __oflag, va_arg(ap, uint32_t));
#else
/* ... and some other toolchains...
*
* error: second argument to 'va_arg' is of promotable type 'mode_t'
* (aka 'unsigned short'); this va_arg has undefined behavior because
* arguments will be promoted to 'int'
*/
n = open(__file, __oflag, va_arg(ap, unsigned int));
#endif
else
n = open(__file, __oflag);
va_end(ap);