bin/xbps-remove: ignore EBUSY errors

EBUSY occurs if xbps tries to remove a directory with unlink(2) that is
a mount point, this happens with `/boot` as example.

https: //github.com/voidlinux/void-packages/issues/7229#issuecomment-319392560
https: //github.com/voidlinux/void-packages/issues/8753
Closes: #259 [via git-merge-pr]
This commit is contained in:
Duncaen 2017-11-01 00:35:44 +01:00
parent c430d8ceb6
commit 3ad6b7a523

View File

@ -108,8 +108,8 @@ state_cb_rm(const struct xbps_state_cb_data *xscd, void *cbdata UNUSED)
case XBPS_STATE_REMOVE_FILE_FAIL:
case XBPS_STATE_REMOVE_FILE_HASH_FAIL:
case XBPS_STATE_REMOVE_FILE_OBSOLETE_FAIL:
/* Ignore errors due to not empty directories */
if (xscd->err == ENOTEMPTY)
/* Ignore errors due to not empty directories or directories being a mount point */
if (xscd->err == ENOTEMPTY || xscd->err == EBUSY)
return 0;
xbps_error_printf("%s\n", xscd->desc);