Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion contrib/win32/win32compat/w32fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ fd_table_initialize()
{
struct w32_io *pio;
HANDLE wh;
char *stdio_mode_env;
int stdio_mode = NONSOCK_SYNC_FD;

stdio_mode_env = getenv("OPENSSH_STDIO_MODE");
if (stdio_mode_env != NULL) {
if (strcmp(stdio_mode_env, "sock") == 0)
stdio_mode = SOCK_FD;
else if (strcmp(stdio_mode_env, "nonsock") == 0)
stdio_mode = NONSOCK_FD;
else if (strcmp(stdio_mode_env, "nonsock_sync") == 0)
stdio_mode = NONSOCK_SYNC_FD;
}

/* table entries representing std in, out and error*/
DWORD wh_index[] = { STD_INPUT_HANDLE , STD_OUTPUT_HANDLE , STD_ERROR_HANDLE };
int fd_num = 0;
Expand All @@ -104,7 +117,7 @@ fd_table_initialize()
return -1;
}
memset(pio, 0, sizeof(struct w32_io));
pio->type = NONSOCK_SYNC_FD;
pio->type = stdio_mode;
pio->handle = wh;
fd_table_set(pio, fd_num);
}
Expand Down