From 58bd3f8dca20f6938408f6b6417de9fd46f68844 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 27 Jul 2016 15:44:20 +1000 Subject: [PATCH] ctdb-tests: Pretend not to ignore return from fgets() With some compilers and picky compiler settings, ignoring the return value of fgets() can cause compilation to fail. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/src/fake_ctdbd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ctdb/tests/src/fake_ctdbd.c b/ctdb/tests/src/fake_ctdbd.c index 143acf87678..35bca88b286 100644 --- a/ctdb/tests/src/fake_ctdbd.c +++ b/ctdb/tests/src/fake_ctdbd.c @@ -568,8 +568,13 @@ static bool reclock_parse(struct ctdbd_context *ctdb) goto fail; } ok: - /* Swallow possible blank line following section */ - fgets(line, sizeof(line), stdin); + /* Swallow possible blank line following section. Picky + * compiler settings don't allow the return value to be + * ignored, so make the compiler happy. + */ + if (fgets(line, sizeof(line), stdin) == NULL) { + ; + } DEBUG(DEBUG_INFO, ("Parsing reclock done\n")); return true; -- 2.11.4.GIT