Void Linux discussion
 help / color / mirror / Atom feed
* [PATCH] bin/xbps-remove: ignore errors from trying to remove(3) a mountpoint
@ 2018-11-13 16:57 ovf
  0 siblings, 0 replies; only message in thread
From: ovf @ 2018-11-13 16:57 UTC (permalink / raw)
  To: voidlinux; +Cc: ovf

Currently when removing package files, xbps-remove attempts to remove package directories.
Where such a directory happens to be a mountpoint, remove(3) (through rmdir(2)) returns EBUSY.
This should be ignored in the same way as ENOTEMPTY.

This can be reproduced with e.g.
 # mount -o bind /etc /etc
 # xbps-install -y tslib >/dev/null
 # xbps-remove  -y tslib >/dev/null
---
 bin/xbps-remove/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/xbps-remove/main.c b/bin/xbps-remove/main.c
index 838e610b..948ea8c5 100644
--- a/bin/xbps-remove/main.c
+++ b/bin/xbps-remove/main.c
@@ -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 mountpoints */
+		if (xscd->err == ENOTEMPTY || xscd->err == EBUSY)
 			return 0;
 
 		xbps_error_printf("%s\n", xscd->desc);
-- 
2.19.1

-- 
You received this message because you are subscribed to the Google Groups "voidlinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to voidlinux+unsubscribe@googlegroups.com.
To post to this group, send email to voidlinux@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/voidlinux/20181113165755.13786-1-ovf%40mm.st.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-13 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 16:57 [PATCH] bin/xbps-remove: ignore errors from trying to remove(3) a mountpoint ovf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).