diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-08-20 00:07:05 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-08-22 02:27:34 +0200 |
| commit | 43e89fb23943b5ffb6854f290592c29cd079bf46 (patch) | |
| tree | 3a295c16aebdcbea5ce733fe61ba8ba639bc4f41 /handler.c | |
| parent | 34b62bd0c47c915a12ff1b81f52b123fc3eb4a69 (diff) | |
Move signal handling to processes
So far, libweb installed a signal handler so as to handle SIGTERM,
SIGPIPE and SIGINT signals so that processes would not have to care
about such details.
However, it is not advisable for libraries to install signal handlers,
as signals are handled on a per-process basis. The previous approach
would be incompatible if several instances of the library were allocated
by the same process.
Unfortunately, this has the undesired side effect of adding the
boilerplate code into the process.
Diffstat (limited to 'handler.c')
| -rw-r--r-- | handler.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -180,6 +180,11 @@ static int remove_client_from_list(struct handler *const h, return ret; } +int handler_notify_close(struct handler *const h) +{ + return server_notify_close(h->server); +} + int handler_listen(struct handler *const h, const unsigned short port, unsigned short *const outport) { |
