svn commit: r208868 - in head/usr.bin: bc dc

Andrey Chernov ache at nagual.pp.ru
Sun Jun 6 12:14:49 UTC 2010


On Sun, Jun 06, 2010 at 03:00:04PM +0300, Kostik Belousov wrote:
> On Sun, Jun 06, 2010 at 11:36:09AM +0000, Gabor Kovesdan wrote:
> > @@ -223,14 +222,11 @@ static const struct jump_entry jump_tabl
> >  	(sizeof(jump_table_data)/sizeof(jump_table_data[0]))
> >  
> >  static void
> > -sighandler(int ignored)
> > +got_sigint(int ignored __unused)
> >  {
> >  
> > -	switch (ignored)
> > -	{
> > -	default:
> > -		bmachine.interrupted = true;
> > -	}
> > +	putchar('\n');
> > +	exit(0);
> >  }
> In general, calling not async-signal safe functions from the signal
> handler is an invitation for undefined behaviour, that usually manifests
> itself as SIGSEGV and SIGBUS.

Yes, better use write(2) and _exit(2) here.

-- 
http://ache.pp.ru/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20100606/7039117d/attachment.pgp


More information about the svn-src-head mailing list