diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-01-20 01:09:18 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-01-20 01:19:57 +0100 |
| commit | 91ff743df9fcee048cb44dba0c7047df04454dd2 (patch) | |
| tree | 1a862b3872c288c173933035ca35a3bd5d40eeb4 /server.c | |
| parent | 43be8d95f681c8240847b4f69a524a0ab20d5c83 (diff) | |
server.c: Fix wrong priority for do_exit
Under some specific circumstances, poll(2) would return a positive
integer, but do_exit might had been previously set. This caused libweb
to ignore SIGTERM, with the potential risk for an endless loop.
Diffstat (limited to 'server.c')
| -rw-r--r-- | server.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -230,13 +230,13 @@ again: res = poll(fds, n, -1); - if (res < 0) + if (do_exit) + { + *exit = true; + goto end; + } + else if (res < 0) { - if (do_exit) - { - *exit = true; - goto end; - } switch (errno) { |
