When falloc() was broken into separate falloc_noinstall() and finstall(), a bug was introduced in kern_openat() such that the error from the vnode open operation was overwritten before it was passed as an argument to dupfdopen(). This broke operations on /dev/{stdin,stdout,stderr}. Fix by preserving the original error number across finstall() so that it is still available. Approved by: re (xxx) Index: kern/vfs_syscalls.c =================================================================== --- kern/vfs_syscalls.c (revision 224841) +++ kern/vfs_syscalls.c (working copy) @@ -1145,10 +1145,11 @@ (error == ENODEV || error == ENXIO) && (td->td_dupfd >= 0)) { /* XXX from fdopen */ + int error_open = error; if ((error = finstall(td, fp, &indx, flags)) != 0) goto bad_unlocked; if ((error = dupfdopen(td, fdp, indx, td->td_dupfd, - flags, error)) == 0) + flags, error_open)) == 0) goto success; } /*