This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
alarm() with negative argument makes no sense.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 5 Mar 2015 12:57:14 +0000 (07:57 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 27 Jun 2015 03:09:39 +0000 (23:09 -0400)
commitadd0dc910759dea695e812146f825ac72b8cd089
tree023a3b4010c1eb09cfef39e1d87ab09bd28aeb07
parent35a328a707ece9e17f07c6d0fd46efae159ade68
alarm() with negative argument makes no sense.

Give by default a warning, do not set the alarm, and return undef.

(the signedness problem detected by Coverity, CID 104837)

alarm() takes and returns unsigned int, not signed.

In other words, the C library function alarm() cannot fail, ever.
See for example:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html
http://linux.die.net/man/3/alarm
https://www.freebsd.org/cgi/man.cgi?query=alarm&sektion=3
pod/perldiag.pod
pp_sys.c
t/lib/warnings/pp_sys