summaryrefslogtreecommitdiffstats
path: root/src/pty.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-23 08:44:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-23 08:44:48 +0000
commitdf3710fc583213108253a978d8ea1ea14426acc0 (patch)
tree8177931c2abf355d2d246925a4c1ebe70f476bac /src/pty.c
parentAdding upstream version 1.7.2. (diff)
downloadttyd-df3710fc583213108253a978d8ea1ea14426acc0.tar.xz
ttyd-df3710fc583213108253a978d8ea1ea14426acc0.zip
Adding upstream version 1.7.3.upstream/1.7.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;
}