# HG changeset patch # User Jim Meyering # Date 1104870172 0 # Node ID 6bfb33d2482d88a1728d6cb9b5b776b504cdfd14 # Parent 5b0578864f09f00e03cefe082c0c960a2e19be1c Changes imported from coreutils. (gl_FUNC_MKSTEMP): Rather than using "conftestXXXXXX" as the mkstemp template, use a temporary directory and an 8.3-friendly template to avoid trouble on systems like DJGPP. Remove the temporary directory right away, rather than waiting for configure's at-exit trap code to do it. Reported by Juan M. Guerrero via Stepan Kasal. diff --git a/m4/mkstemp.m4 b/m4/mkstemp.m4 --- a/m4/mkstemp.m4 +++ b/m4/mkstemp.m4 @@ -1,4 +1,4 @@ -#serial 6 +#serial 8 # On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a # silly limit that it can create no more than 26 files from a given template. @@ -15,26 +15,29 @@ AC_CACHE_CHECK([for mkstemp limitations], gl_cv_func_mkstemp_limitations, [ + mkdir conftest.mkstemp AC_TRY_RUN([ -# include - int main () - { - int i; - for (i = 0; i < 70; i++) - { - char template[] = "conftestXXXXXX"; - int fd = mkstemp (template); - if (fd == -1) - exit (1); - close (fd); - } - exit (0); - } - ], - gl_cv_func_mkstemp_limitations=no, - gl_cv_func_mkstemp_limitations=yes, - gl_cv_func_mkstemp_limitations=yes - ) +# include +# include + int main () + { + int i; + for (i = 0; i < 70; i++) + { + char template[] = "conftest.mkstemp/coXXXXXX"; + int fd = mkstemp (template); + if (fd == -1) + exit (1); + close (fd); + } + exit (0); + } + ], + gl_cv_func_mkstemp_limitations=no, + gl_cv_func_mkstemp_limitations=yes, + gl_cv_func_mkstemp_limitations=yes + ) + rm -rf conftest.mkstemp ] ) fi