diff options
author | Jim Meyering <jim@meyering.net> | 2005-01-03 17:26:28 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-01-03 17:26:28 +0000 |
commit | 302b28318005f962c3c4965cd5fbfa183cf9f6cb (patch) | |
tree | cac87dbc01352ca3cdb4bb314ea135a511efd1c2 /m4/mkstemp.m4 | |
parent | 9c453b2a958bb85f96f795088eb803b019d74aa3 (diff) | |
download | coreutils-302b28318005f962c3c4965cd5fbfa183cf9f6cb.tar.xz |
(gl_FUNC_MKSTEMP): Don't `cd' into the temporary
subdirectory. That would make the subsequent AC_TRY_RUN macro fail,
for lack of the ./confdefs.h file. Instead, use the temporary
directory name as a prefix on the template string.
Include <unistd.h> for the declaration of close.
Diffstat (limited to 'm4/mkstemp.m4')
-rw-r--r-- | m4/mkstemp.m4 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/m4/mkstemp.m4 b/m4/mkstemp.m4 index ffe687415..461736325 100644 --- a/m4/mkstemp.m4 +++ b/m4/mkstemp.m4 @@ -1,4 +1,4 @@ -#serial 7 +#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. @@ -16,15 +16,15 @@ AC_DEFUN([gl_FUNC_MKSTEMP], gl_cv_func_mkstemp_limitations, [ mkdir conftest.mkstemp - ( cd conftest.mkstemp - AC_TRY_RUN([ + AC_TRY_RUN([ # include <stdlib.h> +# include <unistd.h> int main () { int i; for (i = 0; i < 70; i++) { - char template[] = "coXXXXXX.tmp"; + char template[] = "conftest.mkstemp/coXXXXXX.tmp"; int fd = mkstemp (template); if (fd == -1) exit (1); @@ -37,7 +37,6 @@ AC_DEFUN([gl_FUNC_MKSTEMP], gl_cv_func_mkstemp_limitations=yes, gl_cv_func_mkstemp_limitations=yes ) - ) rm -rf conftest.mkstemp ] ) |