From 6eb5239cb5b9663722e0dabb036e7263696ed5aa Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Wed, 20 Jan 2016 22:32:03 +0100 Subject: [PATCH] drbd plugin: improve header lines identification Recent DRBD versions display more detailed build information in `/proc/drbd`, which caused the header identification to fail. Comparing the first part of each line against all known header prefixes will hopefully make this more robust. Fixes #1514 Signed-off-by: Florian Forster --- src/drbd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/drbd.c b/src/drbd.c index cc306dcb..d46bb020 100644 --- a/src/drbd.c +++ b/src/drbd.c @@ -142,8 +142,12 @@ static int drbd_read (void) fields, STATIC_ARRAY_SIZE (fields)); /* ignore headers (first two iterations) */ - if (fields_num < 4) + if ((strcmp(fields[0], "version:") == 0) || + (strcmp(fields[0], "srcversion:") == 0) || + (strcmp(fields[0], "GIT-hash:") == 0)) + { continue; + } if (isdigit(fields[0][0])) { -- 2.30.2