diff options
author | bubulle <bubulle@alioth.debian.org> | 2009-10-30 07:32:23 +0000 |
---|---|---|
committer | bubulle <bubulle@alioth.debian.org> | 2009-10-30 07:32:23 +0000 |
commit | a2772c315ac6646ccc5bad9c59d81aea7777d303 (patch) | |
tree | 15746cc8717fdb6041d8858979a38e34b02e956a /lib | |
parent | 3539d15b6d14ee0eefb2ae046253a5d8b771db24 (diff) | |
download | samba-a2772c315ac6646ccc5bad9c59d81aea7777d303.tar.gz |
Load samba-3.4.3 into branches/samba/upstream.upstream/3.4.3
git-svn-id: svn://svn.debian.org/svn/pkg-samba/branches/samba/upstream@3096 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tevent/tevent_signal.c | 13 | ||||
-rw-r--r-- | lib/tevent/tevent_timed.c | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c index ef9c0cf288..ab170a66cf 100644 --- a/lib/tevent/tevent_signal.c +++ b/lib/tevent/tevent_signal.c @@ -85,24 +85,21 @@ 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); - if (sig_state->sig_handlers[signum] != NULL) { - ev = sig_state->sig_handlers[signum]->se->event_ctx; - /* doesn't matter if this pipe overflows */ - res = write(ev->pipe_fds[1], &c, 1); - } - /* Write to each unique event context. */ for (sl = sig_state->sig_handlers[signum]; sl; sl = sl->next) { - if (sl->se->event_ctx != ev) { + if (sl->se->event_ctx && sl->se->event_ctx != ev) { + ev = sl->se->event_ctx; /* doesn't matter if this pipe overflows */ res = write(ev->pipe_fds[1], &c, 1); - ev = sl->se->event_ctx; } } + + errno = saved_errno; } #ifdef SA_SIGINFO diff --git a/lib/tevent/tevent_timed.c b/lib/tevent/tevent_timed.c index d75653d847..cc51bf60d5 100644 --- a/lib/tevent/tevent_timed.c +++ b/lib/tevent/tevent_timed.c @@ -114,7 +114,7 @@ struct timeval tevent_timeval_add(const struct timeval *tv, uint32_t secs, tv2.tv_sec += secs; tv2.tv_usec += usecs; tv2.tv_sec += tv2.tv_usec / 1000000; - tv2.tv_usec += tv2.tv_usec % 1000000; + tv2.tv_usec = tv2.tv_usec % 1000000; return tv2; } |