diff options
author | Jim Meyering <jim@meyering.net> | 1997-11-08 02:56:10 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-11-08 02:56:10 +0000 |
commit | d87c24480948d79cc107a0c10a9a436192083638 (patch) | |
tree | e56d021bab4f79638c1ecf68e6e9ca2eee2f31c6 /m4 | |
parent | 19058180fafc5d27a820989faa1d3a085ac74437 (diff) | |
download | coreutils-d87c24480948d79cc107a0c10a9a436192083638.tar.xz |
cleanup
use abort for framework errors
Diffstat (limited to 'm4')
-rw-r--r-- | m4/readdir.m4 | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/m4/readdir.m4 b/m4/readdir.m4 index 0bfc459d6..c73c15675 100644 --- a/m4/readdir.m4 +++ b/m4/readdir.m4 @@ -7,7 +7,12 @@ AC_DEFUN(jm_FUNC_READDIR, AC_REQUIRE([AC_HEADER_DIRENT]) AC_CHECK_HEADERS(string.h) AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir, - [AC_TRY_RUN( + [dnl + # Arrange for deletion of the temporary directory this test creates, in + # case the test itself fails to delete everything -- as happens on Sunos. + ac_clean_files="$ac_clean_files conf-dir" + + AC_TRY_RUN( changequote(<<, >>)dnl << # include <stdio.h> @@ -43,9 +48,9 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir, int i; if (mkdir (dir, 0700)) - exit (1); + abort (); if (chdir (dir)) - exit (1); + abort (); for (i = 0; i < 300; i++) { @@ -55,13 +60,13 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir, sprintf (file_name, "%03d", i); out = fopen (file_name, "w"); if (!out) - exit (1); + abort (); if (fclose (out) == EOF) - exit (1); + abort (); } if (chdir ("..")) - exit (1); + abort (); } static void @@ -70,11 +75,11 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir, DIR *dirp; if (chdir (dir)) - exit (1); + abort (); dirp = opendir ("."); if (dirp == NULL) - exit (1); + abort (); while (1) { @@ -86,12 +91,12 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir, continue; if (unlink (dp->d_name)) - exit (1); + abort (); } closedir (dirp); if (chdir ("..")) - exit (1); + abort (); if (rmdir (dir)) exit (1); @@ -118,6 +123,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir, AC_CHECK_FUNCS(WORKING_READDIR) fi + if test $jm_cv_func_working_readdir = yes; then ac_kludge=HAVE_WORKING_READDIR AC_DEFINE_UNQUOTED($ac_kludge) |