diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-09-21 03:16:18 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-10-20 15:00:24 +0200 |
commit | c095ae5221a56da4479bbcda06a4c23628716d43 (patch) | |
tree | 1d40ac9b3972f2d96c5cfd9a19eaa43f1899044c | |
parent | 58c05cf82a8f2927e9402203dadfb6f95266e332 (diff) | |
download | samba-c095ae5221a56da4479bbcda06a4c23628716d43.tar.gz |
tevent: make sure we don't set errno within the signal handler function.
metze
(cherry picked from commit d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb)
(cherry picked from commit 017586bb84a073f03a04ade6fb0bbe26af4112c1)
-rw-r--r-- | lib/tevent/tevent_signal.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c index ef9c0cf2887..0ca2a2760b0 100644 --- a/lib/tevent/tevent_signal.c +++ b/lib/tevent/tevent_signal.c @@ -85,6 +85,7 @@ static void tevent_common_signal_handler(int signum) ssize_t res; struct tevent_common_signal_list *sl; struct tevent_context *ev = NULL; + int saved_errno = errno; SIG_INCREMENT(sig_state->signal_count[signum]); SIG_INCREMENT(sig_state->got_signal); @@ -103,6 +104,8 @@ static void tevent_common_signal_handler(int signum) ev = sl->se->event_ctx; } } + + errno = saved_errno; } #ifdef SA_SIGINFO |