Do not printf a warning if remove(3) returns EEXIST/ENOTEMPTY/EBUSY.
This commit is contained in:
parent
777a91f62a
commit
9759a62e3f
@ -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)
|
||||
|
@ -126,21 +126,23 @@ again:
|
||||
free(file);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Obsolete obj found, remove it.
|
||||
*/
|
||||
if (remove(file) == -1) {
|
||||
if (errno != EEXIST &&
|
||||
errno != ENOTEMPTY &&
|
||||
errno != EBUSY) {
|
||||
xbps_warn_printf("couldn't remove obsole entry "
|
||||
"`%s': %s\n", prop_string_cstring_nocopy(oldstr),
|
||||
"`%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));
|
||||
|
||||
free(file);
|
||||
}
|
||||
if (!dolinks) {
|
||||
|
Loading…
Reference in New Issue
Block a user