+2008-01-18 Guillem Jover <guillem@debian.org>
+
+ * 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 <guillem@debian.org>
* scripts/update-alternatives.pl: Stop parsing '--test' as a valid
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
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);
}
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);
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"),