From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/4] newlib: Allow SAFE_MACROS to be called from cleanup
Date: Tue, 14 Feb 2017 14:52:31 +0100 [thread overview]
Message-ID: <20170214135231.GA1383@rei.lan> (raw)
In-Reply-To: <350522678.4314423.1487078592694.JavaMail.zimbra@redhat.com>
Hi!
OK to commit the patchset with fixed warnings and this addition to the docs?
-------------------------------------------------------------------------------
static void cleanup(void)
{
- if (fd1 > 0 && close(fd1))
- tst_res(TWARN | TERRNO, "close(fd1)");
+ if (fd1 > 0)
+ SAFE_CLOSE(fd1);
- if (fd0 > 0 && close(fd0))
- tst_res(TWARN | TERRNO, "close(fd0)");
+ if (fd0 > 0)
+ SAFE_CLOSE(fd0);
if (mount_flag && tst_umouont(MNTPOINT))
- tst_res(TBROK | TERRNO, "umount(%s)", MNTPOINT);
+ tst_res(TWARN | TERRNO, "umount(%s)", MNTPOINT);
}
-------------------------------------------------------------------------------
+IMPORTANT: 'SAFE_MACROS()' used in cleanup *do not* exit the test. Failure
+ only produces a warning and the 'cleanup()' carries on. This is
+ intentional as we want to execute as much 'cleanup()' as possible.
+
+WARNING: Calling tst_brk() in test 'cleanup()' does not exit the test as well
+ and 'TBROK' is converted to 'TWARN'.
+
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-02-14 13:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 12:26 [LTP] [PATCH 1/4] tst_test.h, test.h: Add mutual exclusion guards Cyril Hrubis
2017-02-14 12:26 ` [LTP] [PATCH 2/4] lib: Redirect to tst_brk_() early Cyril Hrubis
2017-02-14 13:18 ` Jan Stancek
2017-02-14 13:22 ` Cyril Hrubis
2017-02-14 13:36 ` Jan Stancek
2017-02-14 12:26 ` [LTP] [PATCH 3/4] newlib: Allow SAFE_MACROS to be called from cleanup Cyril Hrubis
2017-02-14 13:23 ` Jan Stancek
2017-02-14 13:23 ` Cyril Hrubis
2017-02-14 13:52 ` Cyril Hrubis [this message]
2017-02-14 14:09 ` Jan Stancek
2017-02-14 14:11 ` Cyril Hrubis
2017-02-14 12:26 ` [LTP] [PATCH 4/4] syscalls: Make use of SAFE_MACROS in cleanup Cyril Hrubis
2017-02-14 13:49 ` Jan Stancek
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=20170214135231.GA1383@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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