[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-590-g00e378f
Stefan Metzmacher
metze at samba.org
Sun Sep 20 22:10:30 MDT 2009
The branch, master has been updated
via 00e378f17c39c52689601bc622b9cd78a0cdce12 (commit)
via d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb (commit)
from f917044ec032ad3a3cdc6030f5c63274d7327c2e (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 00e378f17c39c52689601bc622b9cd78a0cdce12
Author: Stefan Metzmacher <metze at samba.org>
Date: Sun Sep 20 23:29:34 2009 +0200
s3:lib/select: don't overwrite errno in the signal handler
metze
commit d13dfbeb6c6ab5b20277439da5b95f1a7f2850eb
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 21 03:16:18 2009 +0200
tevent: make sure we don't set errno within the signal handler function.
metze
-----------------------------------------------------------------------
Summary of changes:
lib/tevent/tevent_signal.c | 3 +++
source3/lib/select.c | 4 ++++
2 files changed, 7 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index ef9c0cf..0ca2a27 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
diff --git a/source3/lib/select.c b/source3/lib/select.c
index a58530a..b5443ff 100644
--- a/source3/lib/select.c
+++ b/source3/lib/select.c
@@ -39,11 +39,15 @@ static volatile unsigned pipe_written, pipe_read;
void sys_select_signal(char c)
{
+ int saved_errno = errno;
+
if (!initialised) return;
if (pipe_written > pipe_read+256) return;
if (write(select_pipe[1], &c, 1) == 1) pipe_written++;
+
+ errno = saved_errno;
}
/*******************************************************************
--
Samba Shared Repository
More information about the samba-cvs
mailing list