fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: fstests@vger.kernel.org, Eryu Guan <guan@eryu.me>,
	Christoph Hellwig <hch@lst.de>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Subject: [PATCH v3 1/8] idmapped-mounts: use die() helper
Date: Thu, 12 Aug 2021 18:01:33 +0200	[thread overview]
Message-ID: <20210812160140.990229-2-brauner@kernel.org> (raw)
In-Reply-To: <20210812160140.990229-1-brauner@kernel.org>

From: Christian Brauner <christian.brauner@ubuntu.com>

Use the dedicated helper to report an error and exit with failure
instead of hand-rolling it.

Cc: Christoph Hellwig <hch@lst.de>
Cc: fstests@vger.kernel.org
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
---
/* v2 */
patch not present

/* v3 */
- Christoph Hellwig <hch@lst.de>:
  - Split into separate patch.
---
 src/idmapped-mounts/idmapped-mounts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/idmapped-mounts/idmapped-mounts.c b/src/idmapped-mounts/idmapped-mounts.c
index 2c212131..69dcc027 100644
--- a/src/idmapped-mounts/idmapped-mounts.c
+++ b/src/idmapped-mounts/idmapped-mounts.c
@@ -8804,10 +8804,8 @@ static bool run_test(struct t_idmapped_mounts suite[], size_t suite_size)
 
 		if (pid == 0) {
 			ret = t->test();
-			if (ret) {
-				fprintf(stderr, "failure: %s\n", t->description);
-				exit(EXIT_FAILURE);
-			}
+			if (ret)
+				die("failure: %s", t->description);
 
 			exit(EXIT_SUCCESS);
 		}
-- 
2.30.2


  reply	other threads:[~2021-08-12 16:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 16:01 [PATCH v3 0/8] Extend idmapped mount testsuite Christian Brauner
2021-08-12 16:01 ` Christian Brauner [this message]
2021-08-14  8:39   ` [PATCH v3 1/8] idmapped-mounts: use die() helper Christoph Hellwig
2021-08-12 16:01 ` [PATCH v3 2/8] idmapped-mounts: switch to getopt_long_only() Christian Brauner
2021-08-14  8:42   ` Christoph Hellwig
2021-08-14 10:13     ` Christian Brauner
2021-08-12 16:01 ` [PATCH v3 3/8] idmapped-mounts: introduce an explicit command line switch for testsuite Christian Brauner
2021-08-14  8:42   ` Christoph Hellwig
2021-08-12 16:01 ` [PATCH v3 4/8] generic/640: add fscaps regression test Christian Brauner
2021-08-12 16:01 ` [PATCH v3 5/8] idmapped-mounts: refactor helpers Christian Brauner
2021-08-12 16:01 ` [PATCH v3 6/8] idmapped-mounts: add nested userns creation helpers Christian Brauner
2021-08-12 16:01 ` [PATCH v3 7/8] generic/641: add nested user namespace tests Christian Brauner

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=20210812160140.990229-2-brauner@kernel.org \
    --to=brauner@kernel.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=hch@lst.de \
    /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;
as well as URLs for NNTP newsgroup(s).