All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3, 2/4] syscalls/chroot02: Convert to new API
Date: Tue, 10 Aug 2021 11:35:56 +0200	[thread overview]
Message-ID: <YRJIfC59VliHPOOs@yuki> (raw)
In-Reply-To: <20210810015235.20965-1-zhanglianjie@uniontech.com>

Hi!
Pushed with a minor changes, thanks.

Diff:

diff --git a/testcases/kernel/syscalls/chroot/chroot02.c b/testcases/kernel/syscalls/chroot/chroot02.c
index 141604406..ad33abdcc 100644
--- a/testcases/kernel/syscalls/chroot/chroot02.c
+++ b/testcases/kernel/syscalls/chroot/chroot02.c
@@ -9,20 +9,23 @@
 /*\
  * [Description]
  *
- * - Create a file in the temporary directory;
- * - Change the root to this temporary directory;
- * - Check whether this file can be accessed in the new root directory;
+ * Basic chroot() functionality test.
+ *
+ * - Create a file in the temporary directory
+ * - Change the root to this temporary directory
+ * - Check whether this file can be accessed in the new root directory
  */
 
 #include <stdlib.h>
 #include "tst_test.h"
 
 #define TMP_FILENAME	"chroot02_testfile"
-static struct stat buf;
 static char *path;
 
 static void verify_chroot(void)
 {
+	struct stat buf;
+
 	if (!SAFE_FORK()) {
 		TST_EXP_PASS(chroot(path), "chroot(%s)", path);
 		if (!TST_PASS)
@@ -36,7 +39,6 @@ static void setup(void)
 {
 	path = tst_get_tmpdir();
 	SAFE_TOUCH(TMP_FILENAME, 0666, NULL);
-	SAFE_STAT(TMP_FILENAME, &buf);
 }
 
 static void cleanup(void)

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2021-08-10  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  1:52 [LTP] [PATCH v3, 2/4] syscalls/chroot02: Convert to new API zhanglianjie
2021-08-10  9:35 ` Cyril Hrubis [this message]

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=YRJIfC59VliHPOOs@yuki \
    --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 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.