Subject: Re: Sane exit from a program on receipt of a signal
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Luke Mewburn <>
List: tech-userlevel
Date: 07/19/2007 10:20:35
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 18, 2007 at 09:34:13AM -0400, der Mouse wrote:
  | >>> 	/* Reset to default signal handler, clear mask, raise signal */
  | >> So if sigaction() succeeds but sigprocmask() fails, we don't
  | >> raise(sig).  Would it be more useful to raise(sig) regardless of
  | >> whether sigprocmask() succeeds?
  | > You're probably right; the code could just be simplified to call the
  | > sig*() functions and not bother checking the return values (except
  | > for possibly sigaction()); the function is intended to terminate the
  | > process.
  | It is?  I thought it was intended to invoke the default action for the
  | signal, which may not be to terminate the process (the most plausible
  | example that comes to mind is SIGTSTP).

A valid point.  I'll present a new implementation, taking
into account the various items of feedback (including Christos')

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.7 (NetBSD)