Merge: nitcorn: handle SIGINT and SIGTERM
authorJean Privat <jean@pryen.org>
Mon, 24 Oct 2016 13:35:10 +0000 (09:35 -0400)
committerJean Privat <jean@pryen.org>
Mon, 24 Oct 2016 13:35:10 +0000 (09:35 -0400)
commite29762ebe29c86649597a484f2990e75b4e140de
treefd563510dd4fcee1604cd5a341d2155e3ef470d2
parenta4fbb83ee103e501ceaa6222db30a45a5f117fd6
parent62782e898fc8a1210c63e6a29c8de692669d8f63
Merge: nitcorn: handle SIGINT and SIGTERM

Intercept SIGINT and SIGTERM to close the server cleanly. The first signal request a clean exit from libevent, so it waits to complete the active events before closing. The second signal reverts to the default signal handler and quits instantly.

Fix #2294.

Pull-Request: #2323
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
lib/libevent.nit