File: path_max.diff

package info (click to toggle)
mesa 25.0.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 306,540 kB
  • sloc: ansic: 2,158,395; xml: 1,012,944; cpp: 519,672; python: 76,489; asm: 38,315; lisp: 20,507; yacc: 12,135; lex: 3,424; sh: 861; makefile: 256
file content (39 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- a/src/util/tests/cache_test.cpp
+++ b/src/util/tests/cache_test.cpp
@@ -84,8 +84,8 @@ check_directories_created(void *mem_ctx,
 {
    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))
--- a/src/util/tests/process_test.c
+++ b/src/util/tests/process_test.c
@@ -36,6 +36,10 @@
 #define PATH_MAX MAX_PATH
 #endif
 
+#if !defined(PATH_MAX) && defined(__GNU__)
+#define PATH_MAX (4096)
+#endif
+
 static bool error = false;
 
 static void
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -42,6 +42,10 @@
 #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) = {