]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tst-realpath-toolong: return "unsupported" when PATH_MAX is undefined
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 3 Aug 2023 19:16:16 +0000 (21:16 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 3 Aug 2023 20:43:27 +0000 (22:43 +0200)
When PATH_MAX is undefined, realpath cannot ever ENAMETOOLONG, so
this test is unsupported.

stdlib/tst-realpath-toolong.c

index 438889029437460141fb29bb23945dfc941ce909..a071fe75446f36489265e7409adac5ae4e33082a 100644 (file)
 #include <unistd.h>
 #include <support/check.h>
 #include <support/temp_file.h>
+#include <support/test-driver.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #define BASENAME "tst-realpath-toolong."
 
-#ifndef PATH_MAX
-# define PATH_MAX 1024
-#endif
-
 int
 do_test (void)
 {
+#ifndef PATH_MAX
+  return EXIT_UNSUPPORTED;
+#else
   char *base = support_create_and_chdir_toolong_temp_directory (BASENAME);
 
   char buf[PATH_MAX + 1];
@@ -48,6 +48,7 @@ do_test (void)
 
   free (base);
   return 0;
+#endif
 }
 
 #include <support/test-driver.c>