The branch, master has been updated
via 76877c6f670321ffdff5f35e879ae1f07a335a46 (commit)
from 65d6f8835fb72d413643a13ed1621a323199a26b (commit)
- Shortlog ------------------------------------------------------------
76877c6 Additionally check if errno is EEXIST after rmdir(2)
Summary of changes:
ChangeLog | 8 ++++++++
debian/changelog | 3 +++
src/help.c | 2 +-
src/remove.c | 4 ++--
4 files changed, 14 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
Details of changes:
commit 76877c6f670321ffdff5f35e879ae1f07a335a46
Author: Guillem Jover <[EMAIL PROTECTED]>
Date: Fri Jan 18 06:41:21 2008 +0200
Additionally check if errno is EEXIST after rmdir(2)
SUSv3 specifies that on non-empty directories it can either return
that or ENOTEMPTY. This should fix run time problems on Solaris.
diff --git a/ChangeLog b/ChangeLog
index f261357..34000b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2008-01-18 Guillem Jover <[EMAIL PROTECTED]>
+ * src/remove.c (ensure_pathname_nonexisting): Additionally check if
+ errno is EEXIST after calling rmdir, per SUSv3 when the directory
+ is not empty errno can be ENOTEMPTY or EEXIST.
+ * src/help.c (removal_bulk_remove_files): Likewise.
+ (removal_bulk_remove_leftover_dirs): Likewise.
+
+2008-01-18 Guillem Jover <[EMAIL PROTECTED]>
+
* scripts/update-alternatives.pl: Stop parsing '--test' as a valid
option.
($testmode): Remove variable.
diff --git a/debian/changelog b/debian/changelog
index 734aada..d690019 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,9 @@ dpkg (1.14.16) UNRELEASED; urgency=low
Based on a patch by Samuel Thibault.
* Remove unimplemented --test option from update-alternatives.
Closes: #392432, #461247
+ * Additionally check if errno is EEXIST after rmdir(2), as SUSv3 specifies
+ that on non-empty directories it can either return that or ENOTEMPTY.
+ This fixes run time problems on Solaris.
[ Frank Lichtenheld ]
* Make the -L option of dpkg-parsechangelog actually work (it's
diff --git a/src/help.c b/src/help.c
index 5c0b800..b6401ab 100644
--- a/src/help.c
+++ b/src/help.c
@@ -510,7 +510,7 @@ void ensure_pathname_nonexisting(const char *pathname) {
if (!chmodsafe_unlink(pathname, &failed)) return; /* OK, it was */
if (errno == ENOTDIR) return;
}
- if (errno != ENOTEMPTY) { /* Huh ? */
+ if (errno != ENOTEMPTY && errno != EEXIST) { /* Huh ? */
char mbuf[250];
snprintf(mbuf, sizeof(mbuf), N_("failed to %s `%%.255s'"), failed);
ohshite(_(mbuf),pathname);
diff --git a/src/remove.c b/src/remove.c
index 4a43167..e985170 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -249,7 +249,7 @@ static void removal_bulk_remove_files(
}
debug(dbg_eachfiledetail, "removal_bulk removing `%s'", fnvb.buf);
if (!rmdir(fnvb.buf) || errno == ENOENT || errno == ELOOP) continue;
- if (errno == ENOTEMPTY) {
+ if (errno == ENOTEMPTY || errno == EEXIST) {
debug(dbg_eachfiledetail, "removal_bulk `%s' was not empty, will try
again later",
fnvb.buf);
push_leftover(&leftover,namenode);
@@ -364,7 +364,7 @@ static void removal_bulk_remove_leftover_dirs(struct
pkginfo *pkg) {
debug(dbg_eachfiledetail, "removal_bulk removing `%s'", fnvb.buf);
if (!rmdir(fnvb.buf) || errno == ENOENT || errno == ELOOP) continue;
- if (errno == ENOTEMPTY) {
+ if (errno == ENOTEMPTY || errno == EEXIST) {
fprintf(stderr,
_("dpkg - warning: while removing %.250s, directory `%.250s' not
empty "
"so not removed.\n"),
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]