[PATCH rtems-libbsd 6-freebsd-12 v2 3/3] rtemsbsd/vfs: Use VOP_REMOVE to remove file nodes

chrisj at rtems.org chrisj at rtems.org
Sun Aug 6 22:00:06 UTC 2023


From: Chris Johns <chrisj at rtems.org>

---
 rtemsbsd/rtems/rtems-kernel-vfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rtemsbsd/rtems/rtems-kernel-vfs.c b/rtemsbsd/rtems/rtems-kernel-vfs.c
index 0817df81..69c9ba56 100644
--- a/rtemsbsd/rtems/rtems-kernel-vfs.c
+++ b/rtemsbsd/rtems/rtems-kernel-vfs.c
@@ -679,7 +679,11 @@ restart:
 		goto restart;
 	}
 	vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK);
-	error = VOP_RMDIR(dvp, vp, &cn);
+	if (vp->v_type == VDIR) {
+		error = VOP_RMDIR(dvp, vp, &cn);
+	} else {
+		error = VOP_REMOVE(dvp, vp, &cn);
+	}
 	vn_finished_write(mp);
 out:
 	return rtems_bsd_error_to_status_and_errno(error);
-- 
2.37.1



More information about the devel mailing list