[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
improve unlink on Solaris
From: |
Eric Blake |
Subject: |
improve unlink on Solaris |
Date: |
Wed, 16 Sep 2009 23:22:48 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
I'm working on a patch to fix unlink("file/") on Solaris 9. But as a
prerequisite (to avoid anyone corrupting their file system if running the unit
test as root, and accidentally unlinking an empty directory), I noticed that
mingw failed to compile unlinkdir.c due to a missing geteuid. This works
around it:
From: Eric Blake <address@hidden>
Date: Wed, 16 Sep 2009 17:18:28 -0600
Subject: [PATCH] unlinkdir: port to mingw
* m4/unlinkdir.m4 (gl_UNLINKDIR): Add mingw to list of platforms
that refuse anyone to unlink a directory.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 6 ++++++
m4/unlinkdir.m4 | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ff11ebe..1b30e94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-09-16 Eric Blake <address@hidden>
+ unlinkdir: port to mingw
+ * m4/unlinkdir.m4 (gl_UNLINKDIR): Add mingw to list of platforms
+ that refuse anyone to unlink a directory.
+
+2009-09-16 Eric Blake <address@hidden>
+
remove: new module
* modules/remove: New file.
* lib/remove.c: Likewise.
diff --git a/m4/unlinkdir.m4 b/m4/unlinkdir.m4
index 0c84375..a8256d1 100644
--- a/m4/unlinkdir.m4
+++ b/m4/unlinkdir.m4
@@ -16,7 +16,7 @@ AC_DEFUN([gl_UNLINKDIR],
AC_LIBOBJ([unlinkdir])
# The Hurd, the Linux kernel, the FreeBSD kernel version 2.2 and later,
- # and Cygwin never let anyone (even root) unlink directories.
+ # Cygwin, and mingw never let anyone (even root) unlink directories.
# If anyone knows of another system for which unlink can never
# remove a directory, please report it to <address@hidden>.
# Unfortunately this is difficult to test for, since it requires root access
@@ -26,7 +26,8 @@ AC_DEFUN([gl_UNLINKDIR],
*-*-gnu[[0-9]]* | \
*-*-linux-* | *-*-linux | \
*-*-freebsd2.2* | *-*-freebsd[[3-9]]* | *-*-freebsd[[1-9]][[0-9]]* | \
- *-cygwin)
+ *-cygwin | \
+ *-mingw)
AC_DEFINE([UNLINK_CANNOT_UNLINK_DIR], [1],
[Define to 1 if unlink (dir) cannot possibly succeed.]);;
esac
--
1.6.4.2
- improve unlink on Solaris,
Eric Blake <=