msg: add a timeout to ping_monitor

Though it should never bee needed, having a timeout in ping_monitor is
a sensible safeguard.

Signed-off-by: Neil Brown <neilb@suse.de>
This commit is contained in:
NeilBrown 2008-07-18 16:37:28 +10:00
parent 33af8567de
commit eb2c876f4d
1 changed files with 2 additions and 2 deletions

4
msg.c
View File

@ -173,11 +173,11 @@ int ping_monitor(char *devname)
return sfd;
/* try to ping existing socket */
if (ack(sfd, 0) != 0)
if (ack(sfd, 20) != 0)
err = -1;
/* check the reply */
if (!err && wait_reply(sfd, 0) != 0)
if (!err && wait_reply(sfd, 20) != 0)
err = -1;
close(sfd);