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:
parent
33af8567de
commit
eb2c876f4d
4
msg.c
4
msg.c
|
@ -173,11 +173,11 @@ int ping_monitor(char *devname)
|
||||||
return sfd;
|
return sfd;
|
||||||
|
|
||||||
/* try to ping existing socket */
|
/* try to ping existing socket */
|
||||||
if (ack(sfd, 0) != 0)
|
if (ack(sfd, 20) != 0)
|
||||||
err = -1;
|
err = -1;
|
||||||
|
|
||||||
/* check the reply */
|
/* check the reply */
|
||||||
if (!err && wait_reply(sfd, 0) != 0)
|
if (!err && wait_reply(sfd, 20) != 0)
|
||||||
err = -1;
|
err = -1;
|
||||||
|
|
||||||
close(sfd);
|
close(sfd);
|
||||||
|
|
Loading…
Reference in New Issue