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
> > $
On Mon, Sep 07, 2015 at 01:49:52PM +0200, Jakub Wilk wrote:
> Hi Peter!
>
> * Peter Pentchev , 2015-09-07, 14:26:
> >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
>
Hi Peter!
* Peter Pentchev , 2015-09-07, 14:26:
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...
In C,
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
--
Jakub Wilk
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
>
Package: debhelper
Version: 9.20150811
Severity: minor
debhelper manpage includes this example of how to embed #DEBHELPER# in
Perl code:
my $temp="set -e\nset -- @ARGV\n" . << 'EOF';
#DEBHELPER#
EOF
system ($temp) / 256 == 0
or die "Problem with debhelper scripts: $!";
6 matches
Mail list logo