bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] bug in gl_FUNC_MKSTEMP


From: Jim Meyering
Subject: Re: [bug-gnulib] bug in gl_FUNC_MKSTEMP
Date: Mon, 20 Dec 2004 16:58:30 +0100

I wrote:

> In any case, now that it's causing trouble for at least
> one other project, I'll address it.  How about this?
>
> 2004-12-20  Jim Meyering  <address@hidden>
>
>       * mkstemp.m4: 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.
>       Reported by Juan M. Guerrero via Stepan Kasal.

Here's a better patch :-)
It does the `cd' in a subshell.

Index: mkstemp.m4
===================================================================
RCS file: /fetish/cu/m4/mkstemp.m4,v
retrieving revision 1.10
diff -u -p -r1.10 mkstemp.m4
--- mkstemp.m4  20 Apr 2004 09:19:52 -0000      1.10
+++ mkstemp.m4  20 Dec 2004 15:50:55 -0000
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
 
 # 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,6 +15,8 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
     AC_CACHE_CHECK([for mkstemp limitations],
       gl_cv_func_mkstemp_limitations,
       [
+        mkdir conftest.mkstemp
+        ( cd conftest.mkstemp
        AC_TRY_RUN([
 #         include <stdlib.h>
          int main ()
@@ -22,7 +24,7 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
            int i;
            for (i = 0; i < 70; i++)
              {
-               char template[] = "conftestXXXXXX";
+               char template[] = "coXXXXXX.tmp";
                int fd = mkstemp (template);
                if (fd == -1)
                  exit (1);
@@ -35,6 +37,7 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
        gl_cv_func_mkstemp_limitations=yes,
        gl_cv_func_mkstemp_limitations=yes
        )
+       )
       ]
     )
   fi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]