]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 16 Mar 1998 13:39:33 +0000 (13:39 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 16 Mar 1998 13:39:33 +0000 (13:39 +0000)
1998-03-16 13:02  Tim Waugh  <tim@cyberelk.demon.co.uk>

* posix/wordexp-tst.sh: Store test results in the
${common_objpfx}posix directory.

* posix/wordexp-test.c: Remove temporary directory afterwards.

ChangeLog
posix/wordexp-test.c
posix/wordexp-tst.sh

index a8562f927c43b548604d9945504cc72f318e00b6..7c0236f19252697119efe7175fd0f20aecc5e2f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1998-03-16 13:02  Tim Waugh  <tim@cyberelk.demon.co.uk>
+
+       * posix/wordexp-tst.sh: Store test results in the
+       ${common_objpfx}posix directory.
+
+       * posix/wordexp-test.c: Remove temporary directory afterwards.
+
 1998-03-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
 
        * libc.map: Export internal versions of cancelable functions.
index 965e26be45a478db1c865b816b778db63d8522df..b8a83c5211cafbf89de8fd3bacc0eaba6be23bc0 100644 (file)
@@ -152,11 +152,12 @@ command_line_test (const char *words)
 int
 main (int argc, char *argv[])
 {
+  const char *globfile[] = { "one", "two", "three", NULL };
   char tmpdir[32];
   struct passwd *pw;
   int test;
   int fail = 0;
-  int fd;
+  int i;
 
   if (argc > 1)
     {
@@ -164,16 +165,22 @@ main (int argc, char *argv[])
       return 0;
     }
 
+  cwd = getcwd (NULL, 0);
   setenv ("IFS", IFS, 1);
 
   /* Set up arena for pathname expansion */
   tmpnam (tmpdir);
-  if (mkdir (tmpdir, S_IRWXU) ||
-      chdir (tmpdir) ||
-      (fd = creat ("one", S_IRWXU)) == -1 || close (fd) ||
-      (fd = creat ("two", S_IRWXU)) == -1 || close (fd) ||
-      (fd = creat ("three", S_IRWXU)) == -1 || close (fd))
+  if (mkdir (tmpdir, S_IRWXU) || chdir (tmpdir))
     return -1;
+  else
+    {
+      int fd;
+
+      for (i = 0; globfile[i]; ++i)
+       if ((fd = creat (globfile[i], S_IRUSR | S_IWUSR)) == -1
+           || close (fd))
+         return -1;
+    }
 
   for (test = 0; test_case[test].retval != -1; test++)
     if (testit (&test_case[test]))
@@ -195,6 +202,16 @@ main (int argc, char *argv[])
        ++fail;
     }
 
+  /* Clean up */
+  for (i = 0; globfile[i]; ++i)
+    remove (globfile[i]);
+
+  if (cwd = NULL)
+    strcpy (cwd, "..");
+
+  chdir (cwd);
+  rmdir (tmpdir);
+
   return fail != 0;
 }
 
index a5445f1ee62799218a3cac8caa52040374dd3c1b..e1f0b788304291c94aa0f07e9f74889ad7555764 100755 (executable)
@@ -8,7 +8,7 @@ common_objpfx=$1; shift
 elf_objpfx=$1; shift
 rtld_installed_name=$1; shift
 
-: ${TMPDIR=/tmp}
+: ${TMPDIR=${common_objpfx}posix}
 testout=$TMPDIR/wordexp-test-result
 
 failed=0
This page took 0.043124 seconds and 5 git commands to generate.