[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
rmdir: simplify test
From: |
Bruno Haible |
Subject: |
rmdir: simplify test |
Date: |
Sun, 4 Apr 2010 16:10:24 +0100 |
User-agent: |
KMail/1.9.9 |
Hi,
The rmdir module does not satisfy the common idiom (distinguish
missing and broken function). But this part is already marked as
"simplify this module in 2010 if no one reports a missing rmdir"
Did someone report a missing rmdir? Or can we remove this part of
the autoconf test?
Here's the proposed patch:
2010-04-04 Bruno Haible <address@hidden>
Assume rmdir exists.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Remove test whether rmdir exists.
* doc/posix-functions/rmdir.texi: Remove mention of "old platforms".
--- doc/posix-functions/rmdir.texi.orig Sun Apr 4 17:06:02 2010
+++ doc/posix-functions/rmdir.texi Sun Apr 4 17:03:58 2010
@@ -16,8 +16,6 @@
This function fails with @code{EINVAL} instead of the expected
@code{ENOTDIR} for @code{rmdir("file/")} on some platforms:
mingw.
address@hidden
-This function is missing on some old platforms.
@end itemize
Portability problems not fixed by Gnulib:
--- m4/rmdir.m4.orig Sun Apr 4 17:06:02 2010
+++ m4/rmdir.m4 Sun Apr 4 17:05:23 2010
@@ -1,4 +1,4 @@
-# rmdir.m4 serial 7
+# rmdir.m4 serial 8
dnl Copyright (C) 2002, 2005, 2009-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,37 +8,22 @@
[
AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- dnl FIXME: simplify this module in 2010 if no one reports a missing rmdir
- AC_REPLACE_FUNCS([rmdir])
- if test $ac_cv_func_rmdir = no; then
- REPLACE_RMDIR=1
- # If someone lacks rmdir, make configure fail, and request
- # a bug report to inform us about it.
- if test x"$SKIP_RMDIR_CHECK" != xyes; then
- AC_MSG_FAILURE([Your system lacks the rmdir function.
- Please report this, along with the output of "uname -a", to the
- address@hidden mailing list. To continue past this point,
- rerun configure with SKIP_RMDIR_CHECK=yes.
- E.g., ./configure SKIP_RMDIR_CHECK=yes])
- fi
- else
- dnl Detect cygwin 1.5.x bug.
- AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
- [mkdir conftest.dir
- touch conftest.file
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stdio.h>
- #include <errno.h>
- #include <unistd.h>
+ dnl Detect cygwin 1.5.x bug.
+ AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
+ [mkdir conftest.dir
+ touch conftest.file
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>
+ #include <errno.h>
+ #include <unistd.h>
]], [[return !rmdir ("conftest.file/") || errno != ENOTDIR
|| !rmdir ("conftest.dir/./");]])],
- [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
- [gl_cv_func_rmdir_works="guessing no"])
- rm -rf conftest.dir conftest.file])
- if test x"$gl_cv_func_rmdir_works" != xyes; then
- REPLACE_RMDIR=1
- AC_LIBOBJ([rmdir])
- fi
+ [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
+ [gl_cv_func_rmdir_works="guessing no"])
+ rm -rf conftest.dir conftest.file])
+ if test x"$gl_cv_func_rmdir_works" != xyes; then
+ REPLACE_RMDIR=1
+ AC_LIBOBJ([rmdir])
fi
])
- rmdir: simplify test,
Bruno Haible <=