From 811fb5982f856492ae02dc58e61dd8d40228d1a9 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Tue, 27 Jul 2021 00:24:55 +0800 Subject: [PATCH] pty: fix error handling --- src/pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pty.c b/src/pty.c index 5345d18..daa34c3 100644 --- a/src/pty.c +++ b/src/pty.c @@ -418,7 +418,7 @@ int pty_spawn(pty_process *process, pty_read_cb read_cb, pty_exit_cb exit_cb) { pid = forkpty(&master, NULL, NULL, &size); if (pid < 0) { status = -errno; - goto error; + return status; } else if (pid == 0) { setsid(); int ret = execvp(process->argv[0], process->argv); -- 2.43.4