path_max
authorDebian X Strike Force <debian-x@lists.debian.org>
Tue, 17 Jun 2025 09:07:43 +0000 (12:07 +0300)
committerTimo Aaltonen <tjaalton@debian.org>
Tue, 17 Jun 2025 09:07:43 +0000 (12:07 +0300)
Gbp-Pq: Name path_max.diff

src/gallium/auxiliary/pipe-loader/pipe_loader.c
src/util/tests/cache_test.cpp
src/util/tests/process_test.c

index 721204d95a7c302c3200c0b4e60a0d43bca8183f..b97b2a4e57ffd7ca6686f758642e6facdde11a33 100644 (file)
 #define PATH_MAX _MAX_PATH
 #endif
 
+#if !defined(PATH_MAX) && defined(__GNU__)
+#define PATH_MAX (4096)
+#endif
+
 #define MODULE_PREFIX "pipe_"
 
 static int (*backends[])(struct pipe_loader_device **, int) = {
index f181178c809335c07314d229d85a2cc395d26b0f..0e9430386a67603c4aaee09fbb98b6b949d01048 100644 (file)
@@ -88,8 +88,8 @@ check_directories_created(void *mem_ctx, const char *cache_dir)
 {
    bool sub_dirs_created = false;
 
-   char buf[PATH_MAX];
-   if (getcwd(buf, PATH_MAX)) {
+   char *buf = getcwd(NULL, 0);
+   if (buf) {
       char *full_path = ralloc_asprintf(mem_ctx, "%s%s", buf, ++cache_dir);
       struct stat sb;
       if (stat(full_path, &sb) != -1 && S_ISDIR(sb.st_mode))
index dd4e7bf8c7acf1dd7c689fb32875d31f35d02d64..0e937e2c134fa46f69e00a43b633f78fabc94638 100644 (file)
 #define PATH_MAX MAX_PATH
 #endif
 
+#if !defined(PATH_MAX) && defined(__GNU__)
+#define PATH_MAX (4096)
+#endif
+
 static bool error = false;
 
 static void