summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-07-27 15:44:20 +1000
committerStefan Metzmacher <metze@samba.org>2016-07-28 05:00:18 +0200
commit58bd3f8dca20f6938408f6b6417de9fd46f68844 (patch)
treea2d5014fabe6b8bf0736df2576a384ead923536a /ctdb
parent2f7096494badbd4453d8a85dd3d56ae5614c543c (diff)
downloadsamba-58bd3f8dca20f6938408f6b6417de9fd46f68844.tar.gz
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 <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/src/fake_ctdbd.c9
1 files 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;