The ping command does not respect -w timeout when called as child process

Solution Verified - Updated -

Issue

If the "ping" command is called with "-w " option from a bash script, which is called from C code via system() library call, it does not respect the specified timeout deadline in some cases.
if the C code manipulates blocked or ignored signal masks in such a way that signal 14 (SIGALRM) is blocked, then the ping than fails.
If such a ping is used to a non existent or unavailable IP address with-w less then 3, the ping returns after 3 seconds, and not the time specified by -w.

Environment

Rhel 6
iputils rpm version less then iputils-20071127-24.el6.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content