1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-14 09:25:41 +00:00

Fix windows ifdef.

This commit is contained in:
Calvin Rose 2020-11-15 19:55:58 -06:00
parent b1c0ad5e42
commit 1b6272db2e

View File

@ -541,7 +541,7 @@ static JanetStream *get_stdio_for_handle(JanetHandle handle, void *orig, int isw
/* duplicate handle when converting file to stream */ /* duplicate handle when converting file to stream */
#ifdef JANET_WINDOWS #ifdef JANET_WINDOWS
HANDLE prochandle = GetCurrentProcess(); HANDLE prochandle = GetCurrentProcess();
HANDLE newHandle; HANDLE newHandle = INVALID_HANDLE_VALUE;
if (!DuplicateHandle(prochandle, handle, prochandle, &newHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { if (!DuplicateHandle(prochandle, handle, prochandle, &newHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
return NULL; return NULL;
} }
@ -550,8 +550,8 @@ static JanetStream *get_stdio_for_handle(JanetHandle handle, void *orig, int isw
if (newHandle < 0) { if (newHandle < 0) {
return NULL; return NULL;
} }
return janet_stream(newHandle, flags, NULL);
#endif #endif
return janet_stream(newHandle, flags, NULL);
} else { } else {
return orig; return orig;
} }