Bugzilla – Attachment 897 Details for
Bug 1029
SIGTERM and cleanup of wtmp files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
cleanup with less code in signal handler
openssh-sigterm-handler.patch (text/plain), 1.34 KB, created by
Darren Tucker
on 2005-05-05 20:30:36 AEST
(
hide
)
Description:
cleanup with less code in signal handler
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2005-05-05 20:30:36 AEST
Size:
1.34 KB
patch
obsolete
>Index: serverloop.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/serverloop.c,v >retrieving revision 1.117 >diff -u -p -r1.117 serverloop.c >--- serverloop.c 13 Aug 2004 11:18:01 -0000 1.117 >+++ serverloop.c 5 May 2005 10:19:09 -0000 >@@ -89,6 +89,7 @@ static int client_alive_timeouts = 0; > */ > > static volatile sig_atomic_t child_terminated = 0; /* The child has terminated. */ >+static volatile sig_atomic_t received_sigterm = 0; > > /* prototypes */ > static void server_init_dispatch(void); >@@ -151,6 +152,12 @@ sigchld_handler(int sig) > errno = save_errno; > } > >+static void >+sigterm_handler(int sig) >+{ >+ received_sigterm = 1; >+} >+ > /* > * Make packets from buffered stderr data, and buffer it for sending > * to the client. >@@ -501,6 +508,7 @@ server_loop(pid_t pid, int fdin_arg, int > /* Initialize the SIGCHLD kludge. */ > child_terminated = 0; > mysignal(SIGCHLD, sigchld_handler); >+ mysignal(SIGTERM, sigterm_handler); > > /* Initialize our global variables. */ > fdin = fdin_arg; >@@ -629,6 +637,9 @@ server_loop(pid_t pid, int fdin_arg, int > wait_until_can_do_something(&readset, &writeset, &max_fd, > &nalloc, max_time_milliseconds); > >+ if (received_sigterm) >+ cleanup_exit(255); >+ > /* Process any channel events. */ > channel_after_select(readset, writeset); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1029
:
895
|
897
|
909
|
1016