Index: sys/kern/vfs_vnops.c =================================================================== RCS file: /cvsroot/src/sys/kern/vfs_vnops.c,v retrieving revision 1.217 diff -u -p -r1.217 vfs_vnops.c --- sys/kern/vfs_vnops.c 30 Jun 2021 11:20:32 -0000 1.217 +++ sys/kern/vfs_vnops.c 30 Jun 2021 17:43:53 -0000 @@ -173,6 +173,9 @@ vn_open(struct vnode *at_dvp, struct pat KASSERT((nmode & (TRYEMULROOT | NOCHROOT)) == nmode); + KASSERT(ret_vp != NULL); + KASSERT((ret_domove == NULL) == (ret_fd == NULL)); + if ((fmode & (O_CREAT | O_DIRECTORY)) == (O_CREAT | O_DIRECTORY)) return EINVAL; @@ -332,9 +335,11 @@ out: case EDUPFD: case EMOVEFD: /* if the caller isn't prepared to handle fds, fail for them */ - KASSERTMSG(ret_domove && ret_fd, - "caller did not supply ret_domove and ret_fd for %d", - error); + if (ret_fd == NULL) { + error = EOPNOTSUPP; + break; + } + error = 0; *ret_vp = NULL; *ret_domove = error == EMOVEFD; *ret_fd = l->l_dupfd;