From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] /vm/hugepage/thp/thp05: cleanup should not use safe macros
Date: Tue, 16 Dec 2014 15:47:55 +0100 [thread overview]
Message-ID: <20141216144754.GA4322@rei> (raw)
In-Reply-To: <152932834.6076324.1417612296820.JavaMail.zimbra@redhat.com>
Hi!
Rebased and pushed with a few cosmetic changes (see below), thanks.
> +int file_scanf(const char *file, const int lineno,
> + const char *path, const char *fmt, ...)
> +{
> + va_list va;
> + FILE *f;
> + int exp_convs, ret;
> +
> + f = fopen(path, "r");
> +
> + if (f == NULL) {
> + tst_resm(TWARN,
> + "Failed to close FILE '%s' at %s:%d",
^
open
> + path, file, lineno);
> + return 1;
> + }
> +
...
> + if (fclose(f)) {
> + tst_resm(TWARN,
> + "Failed to close FILE '%s' at %s:%d",
> + path, file, lineno);
> + return 1;
> + }
> +
> + return 0;
> +
> +err:
> + if (fclose(f)) {
> + tst_resm(TWARN,
> + "Failed to close FILE '%s' at %s:%d",
> + path, file, lineno);
> + return 1;
^
This is not needed because of the return 1 right below.
> + }
> + return 1;
> +}
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next parent reply other threads:[~2014-12-16 14:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1417612136-10890-1-git-send-email-liwang@redhat.com>
[not found] ` <152932834.6076324.1417612296820.JavaMail.zimbra@redhat.com>
2014-12-16 14:47 ` Cyril Hrubis [this message]
[not found] <1417596291-8540-1-git-send-email-liwang@redhat.com>
[not found] ` <373996084.5962831.1417596425167.JavaMail.zimbra@redhat.com>
2014-12-03 10:50 ` [LTP] [PATCH] /vm/hugepage/thp/thp05: cleanup should not use safe macros Cyril Hrubis
[not found] <1417512939-6435-1-git-send-email-liwang@redhat.com>
[not found] ` <2046852420.5414979.1417513768451.JavaMail.zimbra@redhat.com>
2014-12-02 12:00 ` Cyril Hrubis
2014-10-23 3:31 Li Wang
2014-11-06 10:22 ` Cyril Hrubis
[not found] ` <857789373.5490769.1415284744752.JavaMail.zimbra@redhat.com>
2014-11-26 14:50 ` Cyril Hrubis
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=20141216144754.GA4322@rei \
--to=chrubis@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/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