[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-624-g455d44d

Volker Lendecke vlendec at samba.org
Tue Sep 22 02:50:45 MDT 2009


The branch, master has been updated
       via  455d44d9618afdc1d1f4198ae9f64ccc56dee62f (commit)
      from  f54ef5f20fa4809847c89ce0c393111807ca31a2 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 455d44d9618afdc1d1f4198ae9f64ccc56dee62f
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Sep 22 10:32:10 2009 +0930

    lib/tevent: a cleaner fix for be4ac227842530d484659f2db683453366326d8b segv
    
    Revert 23abcd2318c69753aa2a144e1dc0f9cf9efdb705 and fix logic bug.
    
    The current code loops through the event contexts, when it sees a different
    one, it notifies the current one (ev) and updates ev to point to the new one.
    
    This is dumb, because:
    (1) ev starts as NULL, so this code crashes, and
    (2) The final context will not be notified.
    
    The correct fix for this is to update ev to the new one, then notify it.
    Volker's fix works because we currently always have one event context.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/tevent_signal.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index 0ca2a27..d3325b6 100644
--- a/lib/tevent/tevent_signal.c
+++ b/lib/tevent/tevent_signal.c
@@ -90,18 +90,12 @@ static void tevent_common_signal_handler(int signum)
 	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) {
+			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;
 		}
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list