OpenSSH 2.4.0 patch call..

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Sat Dec 30 05:57:07 EST 2000


On Thu, Dec 28, 2000 at 04:09:07AM +0100, Kevin Steves wrote:
> On Wed, 27 Dec 2000 mouring at etoh.eviladmin.org wrote:
> : Is there any undisputed patches still out not applied to the current
> : portable CVS tree?
> 
> not a patch per se but proto 2 is broken on hp-ux due to the issue with
> the SIGCHLD handler being reinstalled before a wait().

i think we should switch to sigaction since the sematics for
signal() are different on every system.

e.g. replace signal() with mysignal():

typedef       void (*mysig_t)(int);   

mysig_t
mysignal(int s, mysig_t a)
{
	struct sigaction sa, osa;

	memset(&sa, 0, sizeof sa);
	sigemptyset(&sa.sa_mask);
	sa.sa_flags = 0;
	sa.sa_handler = a;
	if (sigaction(s, &sa, &osa) < 0)
		return (mysig_t)-1;
	return (osa.sa_handler);
}

mysignal can fallback to signal if sigaction is not available.
with mysignal() we don't need to reinstall signalhandlers.

comments?

-markus





More information about the openssh-unix-dev mailing list