Ticket #63603: configure-evaluate-bug.diff

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

Patch to determine how deep configure will go creating sub-directories

  • configure

    old new  
    3636136361/* end confdefs.h.  */
    3636236362
    3636336363#include <errno.h>
     36364#include <stdio.h>
    3636436365#include <stdlib.h>
    3636536366#if HAVE_UNISTD_H
    3636636367# include <unistd.h>
     
    3643436435  initial_cwd_len = strlen (cwd);
    3643536436  free (cwd);
    3643636437
     36438  FILE *f = fopen ("/var/tmp/sub-dirs-file", "a+");
    3643736439  if (1)
    3643836440    {
    3643936441      static char const dir_name[] = "confdir-14B---";
     
    3645036452              break;
    3645136453            }
    3645236454        }
     36455      fprintf (f, "Directory tree built!\n");
    3645336456
    3645436457      /* If libc has the bug in question, this invocation of getcwd
    3645536458         results in a failed assertion.  */
     
    3646136464
    3646236465      /* Call rmdir first, in case the above chdir failed.  */
    3646336466      rmdir (dir_name);
     36467      fprintf (f, "Deleting the lates sub-dir, initial_cwd_len is %lu, TARGET_LEN is %lu, dir_name has %lu string length, desired_depth is %lu.\n", initial_cwd_len, TARGET_LEN, (sizeof dir_name), desired_depth);
    3646436468      while (0 < d--)
    3646536469        {
    3646636470          if (chdir ("..") < 0)
     
    3646836472              fail = 5;
    3646936473              break;
    3647036474            }
    36471           rmdir (dir_name);
     36475           else
     36476            {
     36477              fprintf (f, "Going to remove %s on level %lu\n", dir_name, d);
     36478              rmdir (dir_name);
     36479            }
    3647236480        }
    3647336481    }
    3647436482