From ab0d488c1e3ba7658f61a4d8da022b5afc17737f Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Mon, 5 Nov 2012 11:53:03 -0800 Subject: [PATCH] rsocket: Remove fscanf build warnings Cast fscanf return values to (void) to indicate that we don't care if the call fails. In the case of a failure, we simply fall back to using default values. Problem reported by Or Gerlitz Signed-off-by: Sean Hefty --- src/rsocket.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rsocket.c b/src/rsocket.c index 74dbcc77..58fcb8e5 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -256,12 +256,12 @@ void rs_configure(void) goto out; if ((f = fopen(RS_CONF_DIR "/polling_time", "r"))) { - fscanf(f, "%u", &polling_time); + (void) fscanf(f, "%u", &polling_time); fclose(f); } if ((f = fopen(RS_CONF_DIR "/inline_default", "r"))) { - fscanf(f, "%hu", &def_inline); + (void) fscanf(f, "%hu", &def_inline); fclose(f); if (def_inline < RS_MIN_INLINE) @@ -269,17 +269,17 @@ void rs_configure(void) } if ((f = fopen(RS_CONF_DIR "/sqsize_default", "r"))) { - fscanf(f, "%hu", &def_sqsize); + (void) fscanf(f, "%hu", &def_sqsize); fclose(f); } if ((f = fopen(RS_CONF_DIR "/rqsize_default", "r"))) { - fscanf(f, "%hu", &def_rqsize); + (void) fscanf(f, "%hu", &def_rqsize); fclose(f); } if ((f = fopen(RS_CONF_DIR "/mem_default", "r"))) { - fscanf(f, "%u", &def_mem); + (void) fscanf(f, "%u", &def_mem); fclose(f); if (def_mem < 1) @@ -287,14 +287,14 @@ void rs_configure(void) } if ((f = fopen(RS_CONF_DIR "/wmem_default", "r"))) { - fscanf(f, "%u", &def_wmem); + (void) fscanf(f, "%u", &def_wmem); fclose(f); if (def_wmem < RS_SNDLOWAT) def_wmem = RS_SNDLOWAT << 1; } if ((f = fopen(RS_CONF_DIR "/iomap_size", "r"))) { - fscanf(f, "%hu", &def_iomap_size); + (void) fscanf(f, "%hu", &def_iomap_size); fclose(f); /* round to supported values */ -- 2.41.0