Stop translating the ERESTART error from the open(2) into EINTR.

Posix requires that open(2) is restartable for SA_RESTART.

For non-posix objects, in particular, devfs nodes, still disable
automatic restart of the opens. The open call to a driver could have
significant side effects for the hardware.

Noted and reviewed by:	jilles
Discussed with:	bde
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2013-02-07 14:53:33 +00:00
parent f710aaa725
commit 2ca4998342
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246472
2 changed files with 4 additions and 3 deletions

View file

@ -1089,8 +1089,11 @@ devfs_open(struct vop_open_args *ap)
vn_lock(vp, vlocked | LK_RETRY); vn_lock(vp, vlocked | LK_RETRY);
dev_relthread(dev, ref); dev_relthread(dev, ref);
if (error) if (error != 0) {
if (error == ERESTART)
error = EINTR;
return (error); return (error);
}
#if 0 /* /dev/console */ #if 0 /* /dev/console */
KASSERT(fp != NULL, ("Could not vnode bypass device on NULL fp")); KASSERT(fp != NULL, ("Could not vnode bypass device on NULL fp"));

View file

@ -1106,8 +1106,6 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
goto success; goto success;
} }
if (error == ERESTART)
error = EINTR;
goto bad; goto bad;
} }
td->td_dupfd = 0; td->td_dupfd = 0;