Do not printf a warning if remove(3) returns EEXIST/ENOTEMPTY/EBUSY.

This commit is contained in:
Juan RP 2011-02-25 10:51:43 +01:00
parent 777a91f62a
commit 9759a62e3f
2 changed files with 13 additions and 10 deletions

View File

@ -153,10 +153,11 @@ xbps_remove_pkg_files(prop_dictionary_t dict, const char *key)
* Remove the object if possible.
*/
if (remove(path) == -1) {
if (xhp->flags & XBPS_FLAG_VERBOSE)
if (errno != EEXIST &&
errno != ENOTEMPTY &&
errno != EBUSY)
xbps_warn_printf("can't remove %s `%s': %s\n",
curobj, file, strerror(errno));
} else {
/* Success */
if (xhp->flags & XBPS_FLAG_VERBOSE)

View File

@ -126,21 +126,23 @@ again:
free(file);
continue;
}
/*
* Obsolete obj found, remove it.
*/
if (remove(file) == -1) {
xbps_warn_printf("couldn't remove obsole entry "
"`%s': %s\n", prop_string_cstring_nocopy(oldstr),
strerror(errno));
if (errno != EEXIST &&
errno != ENOTEMPTY &&
errno != EBUSY) {
xbps_warn_printf("couldn't remove obsole entry "
"`%s': %s\n",
prop_string_cstring_nocopy(oldstr),
strerror(errno));
}
free(file);
continue;
}
if (xhp->flags & XBPS_FLAG_VERBOSE)
xbps_printf("Removed obsolete entry: %s\n",
prop_string_cstring_nocopy(oldstr));
xbps_printf("Removed obsolete entry: %s\n",
prop_string_cstring_nocopy(oldstr));
free(file);
}
if (!dolinks) {