SOLARIS:SIGPIPE in nmbd (PR#8723)

Jeremy Allison jallison at cthulhu.engr.sgi.com
Tue Sep 1 17:52:29 GMT 1998


appro at fy.chalmers.se wrote:
> 
> No, it's not:-)
> 
>         static int sig_pipe(void)
>         {
>           BlockSignals( True, SIGPIPE );
> 
>           DEBUG( 0, ("Got SIGPIPE\n") );
>           if ( !is_daemon )
>             exit(1);
>           BlockSignals( False, SIGPIPE );
>         #ifndef DONT_REINSTALL_SIG
>           signal(SIGHUP,SIGNAL_CAST sig_pipe);
> WOW!!! -------------^^^
>         #endif
>           return(0);
>         } /* sig_pipe */
> 
> I'm speechless... 


Guilty as charged I'm afraid. I screwed that up - I don't
know how - just a 'cut-n-paste' bug I'm afraid. Of course
once I'd done the cut-n-paste I didn't need to check it,
how could it be incorrect as it'd come from another (correct)
part of the code :-(.

This is a good example of why Open Source is a "good thing" (tm).

> Another thing! As we don't actually have any control
> over the rate this particular signal is delivered the idea of setting
> signal handler after unblocking doesn't sound like good one. I even
> would love to see this signal blocked at entry point to the handler.
> Basically I achieve this with in following way (on Solaris, relative to
> p10):
> 

Your code is definately correct, and is the method we
are using in the next major Samba release (Samba-2.0).

Sorry for the stupid bug.

Yours miserably,

	Jeremy Allison,
	Samba Team.

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------


More information about the samba mailing list