diff options
Diffstat (limited to '')
-rw-r--r-- | src/pty.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -65,7 +65,6 @@ static void read_cb(uv_stream_t *stream, ssize_t n, const uv_buf_t *buf) { pty_process *process = (pty_process *) stream->data; if (n <= 0) { if (n == UV_ENOBUFS || n == 0) return; - if (n != UV_EOF) printf("== uv_read failed with error %ld: %s\n", n, uv_strerror(n)); process->read_cb(process, NULL, true); goto done; } @@ -355,6 +354,8 @@ int pty_spawn(pty_process *process, pty_read_cb read_cb, pty_exit_cb exit_cb) { if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, cwd, &process->si.StartupInfo, &pi)) { print_error("CreateProcessW"); + DWORD exitCode = 0; + if (GetExitCodeProcess(pi.hProcess, &exitCode)) printf("== exit code: %d\n", exitCode); goto cleanup; } |