diff options
author | Jim Meyering <jim@meyering.net> | 2001-11-19 09:56:29 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-11-19 09:56:29 +0000 |
commit | 711933ad30273f0444679780e6d649fd37508504 (patch) | |
tree | 0b65ee8c43b7344949679f93277e2a53d02cbcda /m4 | |
parent | 2ce61398cea4c1ede885c4694b9db5064246c9a7 (diff) | |
download | coreutils-711933ad30273f0444679780e6d649fd37508504.tar.xz |
Close each descriptor immediately so the test
doesn't mistakenly hit the max-open-files limit.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/mkstemp.m4 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/m4/mkstemp.m4 b/m4/mkstemp.m4 index 21bcc381d..a7c12d889 100644 --- a/m4/mkstemp.m4 +++ b/m4/mkstemp.m4 @@ -26,8 +26,10 @@ AC_DEFUN([UTILS_FUNC_MKSTEMP], for (i = 0; i < 30; i++) { char template[] = "$utils_tmpdir_mkstemp/aXXXXXX"; - if (mkstemp (template) == -1) + int fd = mkstemp (template); + if (fd == -1) exit (1); + close (fd); } exit (0); } |