Remove conftestdir{,2} before trying to create the directory.
authorJim Meyering <jim@meyering.net>
Sun, 14 Jan 2001 20:27:56 +0000 (20:27 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 14 Jan 2001 20:27:56 +0000 (20:27 +0000)
Make the entire configure script fail if the mkdir fails.

m4/rename.m4

index 95117d0..50a715e 100644 (file)
@@ -13,23 +13,23 @@ AC_DEFUN(vb_FUNC_RENAME,
  AC_CACHE_CHECK([whether rename is broken],
   vb_cv_func_rename_trailing_slash_bug,
   [
-    if mkdir conftestdir; then
-      vb_cv_func_rename_trailing_slash_bug=no
-    else
-      AC_TRY_RUN([
-#         include <stdio.h>
-          int
-          main ()
-          {
-            exit (rename ("conftestdir/", "conftestdir2") ? 1 : 0);
-          }
-       ],
-       vb_cv_func_rename_trailing_slash_bug=no,
-       vb_cv_func_rename_trailing_slash_bug=yes,
-       dnl When crosscompiling, assume rename is broken.
-       vb_cv_func_rename_trailing_slash_bug=yes)
+    rm -rf conftestdir conftestdir2
+    mkdir conftestdir ||
+      AC_MSG_ERROR([cannot create temporary directory])
+    AC_TRY_RUN([
+#       include <stdio.h>
+        int
+        main ()
+        {
+          exit (rename ("conftestdir/", "conftestdir2") ? 1 : 0);
+        }
+      ],
+      vb_cv_func_rename_trailing_slash_bug=no,
+      vb_cv_func_rename_trailing_slash_bug=yes,
+      dnl When crosscompiling, assume rename is broken.
+      vb_cv_func_rename_trailing_slash_bug=yes)
+
       rm -rf conftestdir conftestdir2
-    fi
   ])
   if test $vb_cv_func_rename_trailing_slash_bug = yes; then
     AC_LIBOBJ(rename)