[hurd,commited,3/4] tst-realpath-toolong: return "unsupported" when PATH_MAX is undefined

Message ID 20230803204827.1193126-4-samuel.thibault@ens-lyon.org
State Committed
Commit cbf4aa422c82b895ab56ef5e9acda37947ad4184
Headers
Series i686-gnu fixes against fortification |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch fail Patch failed to apply to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 warning Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-arm warning Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_check--master-arm warning Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 warning Patch failed to apply

Commit Message

Samuel Thibault Aug. 3, 2023, 8:48 p.m. UTC
  When PATH_MAX is undefined, realpath cannot ever ENAMETOOLONG, so
this test is unsupported.
---
 stdlib/tst-realpath-toolong.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Patch

diff --git a/stdlib/tst-realpath-toolong.c b/stdlib/tst-realpath-toolong.c
index 4388890294..a071fe7544 100644
--- a/stdlib/tst-realpath-toolong.c
+++ b/stdlib/tst-realpath-toolong.c
@@ -24,18 +24,18 @@ 
 #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>