moonbridge

changeset 292:7c67bdf99cb5

Bugfix in moonbridge_io.c: Do not restore sigmask if not changed
author jbe
date Mon Jun 12 13:57:38 2017 +0200 (2017-06-12)
parents cdf02d09202a
children b355e259c81e
files moonbridge_io.c
line diff
     1.1 --- a/moonbridge_io.c	Mon Jun 12 13:57:13 2017 +0200
     1.2 +++ b/moonbridge_io.c	Mon Jun 12 13:57:38 2017 +0200
     1.3 @@ -1768,12 +1768,14 @@
     1.4      use_timeout ? &timeout : NULL,
     1.5      check_sigterm ? &orig_mask : NULL
     1.6    );
     1.7 -  if (sigprocmask(SIG_SETMASK, &orig_mask, NULL)) abort();
     1.8 -  if (check_sigterm && moonbr_io_sigterm_flag) {
     1.9 -    lua_pushboolean(L, 0);
    1.10 -    lua_pushliteral(L, "SIGTERM received");
    1.11 -    lua_pushboolean(L, 1);
    1.12 -    return 3;
    1.13 +  if (check_sigterm) {
    1.14 +    if (sigprocmask(SIG_SETMASK, &orig_mask, NULL)) abort();
    1.15 +    if (moonbr_io_sigterm_flag) {
    1.16 +      lua_pushboolean(L, 0);
    1.17 +      lua_pushliteral(L, "SIGTERM received");
    1.18 +      lua_pushboolean(L, 1);
    1.19 +      return 3;
    1.20 +    }
    1.21    }
    1.22    if (status == -1) {
    1.23      if (errno == EINTR) {

Impressum / About Us