Mercurial > hg > octave-kai > gnulib-hg
changeset 1094:94131d948599
cleanup
use abort for framework errors
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 08 Nov 1997 02:56:10 +0000 |
parents | a27f0fb535ce |
children | dcd7ee970a8a |
files | m4/readdir.m4 |
diffstat | 1 files changed, 16 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/m4/readdir.m4 +++ b/m4/readdir.m4 @@ -7,7 +7,12 @@ 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 @@ 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 @@ 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 @@ DIR *dirp; if (chdir (dir)) - exit (1); + abort (); dirp = opendir ("."); if (dirp == NULL) - exit (1); + abort (); while (1) { @@ -86,12 +91,12 @@ 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_CHECK_FUNCS(WORKING_READDIR) fi + if test $jm_cv_func_working_readdir = yes; then ac_kludge=HAVE_WORKING_READDIR AC_DEFINE_UNQUOTED($ac_kludge)