]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
stdlib: Fix tst-canon-bz26341 when the glibc build current working directory is itsel...
authoromain GEISSLER <romain.geissler@amadeus.com>
Wed, 20 Oct 2021 15:01:40 +0000 (12:01 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 20 Oct 2021 15:01:40 +0000 (12:01 -0300)
stdlib/tst-canon-bz26341.c

index acb0fd4ec30537bf2a8c42f7ef8b39806f5a2271..fddf4adff3d62fc79525481c6cc81cc22bb779fe 100644 (file)
@@ -45,6 +45,12 @@ create_link (void)
   TEST_VERIFY_EXIT (fd != -1);
   xclose (fd);
 
+  /* Make filename a canonical path.  */
+  char *saved_filename = filename;
+  filename = realpath (filename, NULL);
+  free (saved_filename);
+  TEST_VERIFY (filename != NULL);
+
   /* Create MAXLINKS symbolic links to the temporary filename.
      On exit, linkname has the last link created.  */
   char *prevlink = filename;