Void Linux discussion
 help / 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; 1+ messages 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] 1+ messages in thread

only message in thread, back to index

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

Void Linux discussion

Archives are clonable: git clone --mirror http://inbox.vuxu.org/voidlinux

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.voidlinux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox