[debhelper-devel] Bug#797904: Bug#797904: Bug#797904: debhelper manpage: #DEBHELPER# in Perl: bad error handling
Peter Pentchev
roam at ringlet.net
Mon Sep 7 11:26:03 UTC 2015
On Sun, Sep 06, 2015 at 11:36:00AM +0200, Niels Thykier wrote:
> On 2015-09-06 11:19, Jakub Wilk wrote:
> >> my $signal = $? & 0xff;
> >
> > This is almost right. :) You need only 7 bits to get the signal number.
> > The eighth bit is on iff core was dumped:
> >
> > $ ulimit -c unlimited
> > $ perl -E 'system("kill -11 \$\$"); say $? & 0xff, ", ", $? & 0x7f'
> > 139, 11
> >
>
> Thanks, corrected. :)
Hm, this is a personal pet peeve, feel free to ignore it :) ...but it
does make me cringe a little bit every time people parse the wait()
status code directly instead of using WIFEXITED(), WEXITCODE() and
friends... Yes, I know that the Linux and FreeBSD kernels do it this
way, up to and including the 0x80 core flag, but still I like to think
that these macros are there for a reason :)
G'luck,
Peter
--
Peter Pentchev roam at ringlet.net roam at FreeBSD.org pp at storpool.com
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20150907/38edb97c/attachment-0001.sig>
More information about the debhelper-devel
mailing list