From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- msg.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/msg.c b/msg.c index 98d6d13..87d3b8d 100644 --- a/msg.c +++ b/msg.c @@ -207,9 +207,14 @@ int fping_monitor(int sfd) int ping_monitor(char *devname) { int sfd = connect_monitor(devname); - int err = fping_monitor(sfd); + int err; + + if (sfd >= 0) { + err = fping_monitor(sfd); + close(sfd); + } else + err = -1; - close(sfd); return err; } -- 1.7.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html