From: Shuanglei Tao Date: Mon, 26 Jul 2021 16:24:55 +0000 (+0800) Subject: pty: fix error handling X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=811fb5982f856492ae02dc58e61dd8d40228d1a9;p=ttyd.git pty: fix error handling --- 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);