From eb2c876f4deef9da9eda6359647e2f6ad2083957 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 18 Jul 2008 16:37:28 +1000 Subject: [PATCH] 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 --- msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msg.c b/msg.c index 123c0e5..78fd7f7 100644 --- 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);