Ticket #63603: configure-evaluate-bug.diff-14

File configure-evaluate-bug.diff-14, 2.0 KB (added by ballapete (Peter "Pete" Dyballa), 3 years ago)

Patch to conftest with resulting 1024 characters path name length, saves the original conftest programme

Line 
1--- configure.orig      2021-10-29 22:40:07.000000000 +0200
2+++ configure   2021-10-29 22:38:39.000000000 +0200
3@@ -36361,6 +36361,7 @@
4 /* end confdefs.h.  */
5 
6 #include <errno.h>
7+#include <stdio.h>
8 #include <stdlib.h>
9 #if HAVE_UNISTD_H
10 # include <unistd.h>
11@@ -36434,6 +36435,7 @@
12   initial_cwd_len = strlen (cwd);
13   free (cwd);
14 
15+  FILE *f = fopen ("/var/tmp/sub-dirs-records", "a+");
16   if (1)
17     {
18       static char const dir_name[] = "confdir-14B---";
19@@ -36449,7 +36451,12 @@
20                 fail = 3; /* Unable to construct deep hierarchy.  */
21               break;
22             }
23+/*           else
24+            {
25+              fprintf (f, "%s on level %lu successfully built.\n", getcwd (NULL, 0), d);
26+            }*/
27         }
28+        fprintf (f, "Directory tree built! We're in %s, path name length is %lu\n", cwd = getcwd (NULL, 0), strlen(cwd));
29 
30       /* If libc has the bug in question, this invocation of getcwd
31          results in a failed assertion.  */
32@@ -36461,6 +36468,7 @@
33 
34       /* Call rmdir first, in case the above chdir failed.  */
35       rmdir (dir_name);
36+      fprintf (f, "Deleting the latest sub-dir, initial_cwd_len is %lu, TARGET_LEN is %lu, dir_name has string length %lu, desired_depth is %lu.\n", initial_cwd_len, TARGET_LEN, (sizeof dir_name), desired_depth);
37       while (0 < d--)
38         {
39           if (chdir ("..") < 0)
40@@ -36468,10 +36476,17 @@
41               fail = 5;
42               break;
43             }
44-          rmdir (dir_name);
45+           else
46+            {
47+/*              rmdir(dir_name);*/
48+              system("/bin/rm -rf confdir-14B---");
49+              perror("/bin/rm");
50+              system("/bin/ls -li >> ls-li-output");
51+              fprintf (f, "Just removed 'confdir-14B---' in %s on level %lu\n", getcwd (NULL, 0), d);
52+            }
53         }
54     }
55-
56+  fclose (f);
57   return fail;
58 }
59 
60@@ -36488,6 +36503,7 @@
61         fi
62 
63 fi
64+mv -v conftest rm-confdir
65 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
66   conftest.$ac_objext conftest.beam conftest.$ac_ext
67 fi