From: Shuanglei Tao Date: Sat, 6 Mar 2021 09:39:05 +0000 (+0800) Subject: pty: rename pty_close to pty_kill X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=02bbbec678c9eb32b3b67bca71a79099f92c63a5;p=ttyd.git pty: rename pty_close to pty_kill --- diff --git a/src/protocol.c b/src/protocol.c index 02eb95d..c2eb016 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -326,7 +326,7 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user, if (process_running(pss->process)) { pty_pause(pss->process); lwsl_notice("killing process, pid: %d\n", pss->process->pid); - pty_close(pss->process, server->sig_code); + pty_kill(pss->process, server->sig_code); } if (server->once && server->client_count == 0) { diff --git a/src/pty.c b/src/pty.c index 9c87b1b..b15c76d 100644 --- a/src/pty.c +++ b/src/pty.c @@ -151,7 +151,7 @@ bool pty_resize(pty_process *process) { #endif } -bool pty_close(pty_process *process, int sig) { +bool pty_kill(pty_process *process, int sig) { process->killed = true; #ifdef _WIN32 return TerminateProcess(process->handle, 1) != 0; diff --git a/src/pty.h b/src/pty.h index 918c452..6b2d738 100644 --- a/src/pty.h +++ b/src/pty.h @@ -68,6 +68,6 @@ void pty_pause(pty_process *process); void pty_resume(pty_process *process); int pty_write(pty_process *process, pty_buf_t *buf); bool pty_resize(pty_process *process); -bool pty_close(pty_process *process, int sig); +bool pty_kill(pty_process *process, int sig); #endif // TTYD_PTY_H