1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 19:42:48 -05:00

Merge branch 'pre-0.64'

This commit is contained in:
Simon Tatham
2014-12-20 18:52:40 +00:00
3 changed files with 18 additions and 8 deletions

View File

@ -696,6 +696,7 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
int ret;
struct command_read_ctx actx, *ctx = &actx;
DWORD threadid;
HANDLE hThread;
fputs(prompt, stdout);
fflush(stdout);
@ -712,8 +713,9 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
ctx->event = CreateEvent(NULL, FALSE, FALSE, NULL);
ctx->line = NULL;
if (!CreateThread(NULL, 0, command_read_thread,
ctx, 0, &threadid)) {
hThread = CreateThread(NULL, 0, command_read_thread, ctx, 0, &threadid);
if (!hThread) {
CloseHandle(ctx->event);
fprintf(stderr, "Unable to create command input thread\n");
cleanup_exit(1);
}
@ -725,6 +727,9 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
assert(ret >= 0);
} while (ret == 0);
CloseHandle(hThread);
CloseHandle(ctx->event);
return ctx->line;
}