]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
msg: add a timeout to ping_monitor
authorNeilBrown <neilb@suse.de>
Fri, 18 Jul 2008 06:37:28 +0000 (16:37 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 18 Jul 2008 06:37:28 +0000 (16:37 +1000)
Though it should never bee needed, having a timeout in ping_monitor is
a sensible safeguard.

Signed-off-by: Neil Brown <neilb@suse.de>
msg.c

diff --git a/msg.c b/msg.c
index 123c0e555666fd46e9beba6b5bc49112a381a482..78fd7f7e26380c9c05e6392438fa2a93ce01b3ad 100644 (file)
--- a/msg.c
+++ b/msg.c
@@ -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);