summaryrefslogtreecommitdiffstats
path: root/src/pty.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/pty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pty.c b/src/pty.c
index adfcc3e..bbe8e22 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -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;
}