diff mbox series

[1/1] Lua: Ignore EROFS errors in lua umount.

Message ID 20210710131001.6165-1-james.hilliard1@gmail.com
State Accepted
Headers show
Series [1/1] Lua: Ignore EROFS errors in lua umount. | expand

Commit Message

James Hilliard July 10, 2021, 1:10 p.m. UTC
It's expected that one can't delete a directory on a read only
filesystem, don't consider umount to have failed if that is the
only error.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 corelib/lua_interface.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
index 86e95bd..a6da6f2 100644
--- a/corelib/lua_interface.c
+++ b/corelib/lua_interface.c
@@ -793,8 +793,10 @@  static int l_umount(lua_State *L) {
 	}
 
 	if (rmdir(target) == -1) {
-		TRACE("Unable to remove directory %s: %s", target, strerror(errno));
-		goto l_umount_exit;
+		if (errno != EROFS) {
+			TRACE("Unable to remove directory %s: %s", target, strerror(errno));
+			goto l_umount_exit;
+		}
 	}
 
 	lua_pop(L, 1);