public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-patches@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 5/6] Cygwin: testsuite: In pathconf01 use the temporary directory instead of "/tmp"
Date: Fri, 26 Aug 2022 13:59:41 +0100	[thread overview]
Message-ID: <20220826125943.49-6-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20220826125943.49-1-jon.turney@dronecode.org.uk>

In pathconf01 use the temporary directory, instead of "/tmp" (which may not exist).
---
 winsup/testsuite/winsup.api/ltp/pathconf01.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/winsup/testsuite/winsup.api/ltp/pathconf01.c b/winsup/testsuite/winsup.api/ltp/pathconf01.c
index 466875f21..990e6defe 100644
--- a/winsup/testsuite/winsup.api/ltp/pathconf01.c
+++ b/winsup/testsuite/winsup.api/ltp/pathconf01.c
@@ -117,6 +117,7 @@
 
 extern void setup();
 extern void cleanup();
+extern char *TESTDIR;
 
 
 
@@ -127,7 +128,7 @@ extern int Tst_count;		/* Test Case counter for tst_* routines */
 int exp_enos[]={0, 0};
 
 int i;
-const char *path = "/tmp";
+const char *path;
 
 struct pathconf_args
 {
@@ -157,6 +158,9 @@ main(int ac, char **av)
     if ( (msg=parse_opts(ac, av, (option_t *) NULL, NULL)) != (char *) NULL )
 	tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
 
+    tst_tmpdir();
+    path = TESTDIR;
+
     /***************************************************************
      * perform global setup for test
      ***************************************************************/
@@ -208,6 +212,8 @@ main(int ac, char **av)
     /***************************************************************
      * cleanup and exit
      ***************************************************************/
+    tst_rmdir();
+
     cleanup();
 
     return 0;
-- 
2.37.2


  parent reply	other threads:[~2022-08-26 13:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 12:59 [PATCH 0/6] testsuite: various fixes Jon Turney
2022-08-26 12:59 ` [PATCH 1/6] Cygwin: testsuite: Don't write coredump in a child which is expected to segfault Jon Turney
2022-08-26 12:59 ` [PATCH 2/6] Cygwin: testsuite: Remove passing tests from XFAIL list Jon Turney
2022-08-26 12:59 ` [PATCH 3/6] Cygwin: testsuite: Fix TEST_RETURN for 64-bit Jon Turney
2022-08-26 12:59 ` [PATCH 4/6] Cygwin: testsuite: Fix size of write to temporary file to be mmap()ed Jon Turney
2022-08-26 12:59 ` Jon Turney [this message]
2022-08-26 12:59 ` [PATCH 6/6] Cygwin: testsuite: Add x86_64 code to "dynamically load cygwin" test Jon Turney
2022-08-26 16:07 ` [PATCH 0/6] testsuite: various fixes Corinna Vinschen

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=20220826125943.49-6-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-patches@cygwin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).