summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-09-21 03:16:18 +0200
committerStefan Metzmacher <metze@samba.org>2009-09-21 05:54:41 +0200
commitd13dfbeb6c6ab5b20277439da5b95f1a7f2850eb (patch)
tree697c623eff2f19b767c73cac04fc7bc66a1e1ece
parentf917044ec032ad3a3cdc6030f5c63274d7327c2e (diff)
downloadsamba-d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb.tar.gz
samba-d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb.tar.bz2
samba-d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb.zip
tevent: make sure we don't set errno within the signal handler function.
metze
-rw-r--r--lib/tevent/tevent_signal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index ef9c0cf288..0ca2a2760b 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