From: Eric Dumazet <eric.dumazet@gmail.com>
To: Christoph Paasch <christoph.paasch@uclouvain.be>
Cc: Stephen Hemminger <stephen@networkplumber.org>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 1/2] ss: Fix compiler errors of unused return-values
Date: Mon, 22 Jul 2013 08:38:59 -0700 [thread overview]
Message-ID: <1374507539.4990.17.camel@edumazet-glaptop> (raw)
In-Reply-To: <1374350298-1177-2-git-send-email-christoph.paasch@uclouvain.be>
On Sat, 2013-07-20 at 21:58 +0200, Christoph Paasch wrote:
> Many errors when compiling with gcc 4.7.3 about unused return-values
> upon the calls to fgets and fscanf:
>
> For the calls to fscanf we can't really do anything about it, and just
> do an empty if-statement to make the compiler happy.
>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> misc/ss.c | 30 +++++++++++++++++++++---------
> 1 file changed, 21 insertions(+), 9 deletions(-)
>
> diff --git a/misc/ss.c b/misc/ss.c
> index c0369f1..0f71108 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -302,7 +302,7 @@ static void user_ent_hash_build(void)
>
> snprintf(tmp, sizeof(tmp), "%s/%d/stat", root, pid);
> if ((fp = fopen(tmp, "r")) != NULL) {
> - fscanf(fp, "%*d (%[^)])", process);
> + if (fscanf(fp, "%*d (%[^)])", process) == EOF);
This is really ugly :(
next prev parent reply other threads:[~2013-07-22 15:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-20 19:58 [PATCH iproute2 0/2] Fix compiler-errors with gcc 4.7.3 Christoph Paasch
2013-07-20 19:58 ` [PATCH iproute2 1/2] ss: Fix compiler errors of unused return-values Christoph Paasch
2013-07-22 14:54 ` Stephen Hemminger
2013-07-22 15:06 ` Denis Kirjanov
2013-07-22 15:35 ` Stephen Hemminger
2013-07-22 15:14 ` Christoph Paasch
2013-07-22 15:38 ` Eric Dumazet [this message]
2013-07-22 17:26 ` Ben Hutchings
2013-07-20 19:58 ` [PATCH iproute2 2/2] lnstat: " Christoph Paasch
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=1374507539.4990.17.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=christoph.paasch@uclouvain.be \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox