diff options
author | kib <kib@FreeBSD.org> | 2013-02-07 14:53:33 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-02-07 14:53:33 +0000 |
commit | 92d95b840647151da87b35dd403d68da90f88a98 (patch) | |
tree | 09027ddd99aff592b1f3d6e1f1596b8e2c3878d1 /sys/fs/devfs | |
parent | 1afd4972b014971ca36bfe32d568b55a25bce377 (diff) | |
download | FreeBSD-src-92d95b840647151da87b35dd403d68da90f88a98.zip FreeBSD-src-92d95b840647151da87b35dd403d68da90f88a98.tar.gz |
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
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 9851229..7da9b11 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1089,8 +1089,11 @@ devfs_open(struct vop_open_args *ap) vn_lock(vp, vlocked | LK_RETRY); dev_relthread(dev, ref); - if (error) + if (error != 0) { + if (error == ERESTART) + error = EINTR; return (error); + } #if 0 /* /dev/console */ KASSERT(fp != NULL, ("Could not vnode bypass device on NULL fp")); |