From: ovf <ovf@mm.st>
To: voidlinux@googlegroups.com
Cc: ovf <ovf@mm.st>
Subject: [PATCH] bin/xbps-remove: ignore errors from trying to remove(3) a mountpoint
Date: Tue, 13 Nov 2018 16:57:55 +0000 [thread overview]
Message-ID: <20181113165755.13786-1-ovf@mm.st> (raw)
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.
reply other threads:[~2018-11-13 16:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181113165755.13786-1-ovf@mm.st \
--to=ovf@mm.st \
--cc=voidlinux@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).