Tell the server when the client gets SIGTERM so it can clean up the terminal

properly, rather than just exiting.
This commit is contained in:
Nicholas Marriott 2009-07-30 16:16:19 +00:00
parent 071494d8fa
commit 479d614884

View File

@ -143,7 +143,9 @@ client_main(struct client_ctx *cctx)
logfile("client");
while (!sigterm) {
for (;;) {
if (sigterm)
client_write_server(cctx, MSG_EXITING, NULL, 0);
if (sigchld) {
waitpid(WAIT_ANY, NULL, WNOHANG);
sigchld = 0;