Date: Sun, 6 Jun 2010 16:14:45 +0400 From: Andrey Chernov <ache@nagual.pp.ru> To: Kostik Belousov <kostikbel@gmail.com> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Gabor Kovesdan <gabor@FreeBSD.ORG> Subject: Re: svn commit: r208868 - in head/usr.bin: bc dc Message-ID: <20100606121444.GA82819@nagual.pp.ru> In-Reply-To: <20100606120004.GH83316@deviant.kiev.zoral.com.ua> References: <201006061136.o56Ba9tr029717@svn.freebsd.org> <20100606120004.GH83316@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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])) > > =20 > > static void > > -sighandler(int ignored) > > +got_sigint(int ignored __unused) > > { > > =20 > > - switch (ignored) > > - { > > - default: > > - bmachine.interrupted =3D 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. --=20 http://ache.pp.ru/ --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwLkTQACgkQVg5YK5ZEdN1AdwCgmh3w4ttX7v+kqlLVOeKSBxSu A00AoKDR+1aqTKmR4FVoxt+pVwobUOvO =ZxvZ -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100606121444.GA82819>