From: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: Adrian Chiris <adrianc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH 3/4] crd_read_line(): Rework code to suppress a compiler warning
Date: Sun, 29 Nov 2015 11:45:09 -0800 [thread overview]
Message-ID: <565B55C5.9040006@sandisk.com> (raw)
In-Reply-To: <565B553C.6020005-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Avoid that gcc prints a warning about not checking the result of fgets().
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
---
mstdump/crd_lib/crdump.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mstdump/crd_lib/crdump.c b/mstdump/crd_lib/crdump.c
index 451a944..3e3c4bc 100755
--- a/mstdump/crd_lib/crdump.c
+++ b/mstdump/crd_lib/crdump.c
@@ -504,8 +504,8 @@ static int crd_read_line(IN FILE *fd, OUT char *tmp) {
if (!feof(fd)) {
int c = fgetc(fd);
if (c == '#') {
- char* _ptr=fgets (tmp, 300, fd);
- (void)_ptr;//avoid warning
+ if (fgets(tmp, 300, fd)) {
+ }
tmp[0] = 0;
continue;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-11-29 19:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 19:42 [PATCH 0/4] mstflint source code cleanup patches Bart Van Assche
[not found] ` <565B553C.6020005-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-11-29 19:44 ` [PATCH 1/4] Fix several automake warnings Bart Van Assche
2015-11-29 19:44 ` [PATCH 2/4] Makefile.am: Remove the undefined variable MFT_EXT_LIBS_INC_DIR Bart Van Assche
2015-11-29 19:45 ` Bart Van Assche [this message]
2015-11-29 19:45 ` [PATCH 4/4] Fix compiler warnings about set-but-not-used variables Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=565B55C5.9040006@sandisk.com \
--to=bart.vanassche-xdaiopvojttbdgjk7y7tuq@public.gmane.org \
--cc=adrianc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.