Skip to content

Commit

Permalink
poll: Don't log in a signal handler (#447)
Browse files Browse the repository at this point in the history
qb_log calls malloc() and probably many other non-signal-safe
functions, so don't call it in the signal handler.

Thanks to Honza for spotting this

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
  • Loading branch information
chrissie-c authored Nov 10, 2021
1 parent a60ca50 commit d4b49fb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/loop_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,8 @@ _handle_real_signal_(int signal_num, siginfo_t * si, void *context)
res = write(pipe_fds[1], &sig, sizeof(int32_t));
if (res == -1 && errno == EAGAIN) {
goto try_again;
} else if (res != sizeof(int32_t)) {
qb_util_log(LOG_ERR,
"failed to write signal to pipe [%d]", res);
}
}
qb_util_log(LOG_TRACE, "got real signal [%d] sent to pipe", sig);
}

static void
Expand Down

0 comments on commit d4b49fb

Please sign in to comment.