Skip to content

Commit f87ac29

Browse files
md5dormando
authored andcommitted
Handle SIGTERM the same as SIGINT
1 parent a3fcd40 commit f87ac29

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

memcached.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4941,7 +4941,7 @@ static void remove_pidfile(const char *pid_file) {
49414941
}
49424942

49434943
static void sig_handler(const int sig) {
4944-
printf("SIGINT handled.\n");
4944+
printf("Signal handled: %s.\n", strsignal(sig));
49454945
exit(EXIT_SUCCESS);
49464946
}
49474947

@@ -5077,8 +5077,9 @@ int main (int argc, char **argv) {
50775077
return EX_OSERR;
50785078
}
50795079

5080-
/* handle SIGINT */
5080+
/* handle SIGINT and SIGTERM */
50815081
signal(SIGINT, sig_handler);
5082+
signal(SIGTERM, sig_handler);
50825083

50835084
/* init settings */
50845085
settings_init();

0 commit comments

Comments
 (0)