summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1997-04-01 22:49:58 +0000
committerjb <jb@FreeBSD.org>1997-04-01 22:49:58 +0000
commit70db53e4e7dc4735a7b70b709b3fa317b1873359 (patch)
tree9672117030dab84e4dcd6a5d2fdcac0398a2b431
parent281aa43a363d7072664aaa4271dc65f8a8f1f61c (diff)
downloadFreeBSD-src-70db53e4e7dc4735a7b70b709b3fa317b1873359.zip
FreeBSD-src-70db53e4e7dc4735a7b70b709b3fa317b1873359.tar.gz
Make error checking less zealous to handle devices like /dev/null
which don't provide a non-blocking interface. This is a short term "fix" which changes a half-lose to a half-win. The thread that accesses a device that does not provide a non-blocking interface will block for its time slice. A medium term solution would be to use rfork. A long-term solution would be some sort of kernel thread/SMP implementation.
-rw-r--r--lib/libc_r/uthread/uthread_fd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc_r/uthread/uthread_fd.c b/lib/libc_r/uthread/uthread_fd.c
index 4c74080..1e61bb7 100644
--- a/lib/libc_r/uthread/uthread_fd.c
+++ b/lib/libc_r/uthread/uthread_fd.c
@@ -29,6 +29,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * $Id$
+ *
*/
#include <errno.h>
#include <fcntl.h>
@@ -102,8 +104,14 @@ _thread_fd_table_init(int fd)
/* Make the file descriptor non-blocking: */
if (_thread_sys_fcntl(fd, F_SETFL,
- _thread_fd_table[fd]->flags | O_NONBLOCK) == -1)
- ret = errno;
+ _thread_fd_table[fd]->flags | O_NONBLOCK) == -1) {
+ /*
+ * Some devices don't support
+ * non-blocking calls (sigh):
+ */
+ if (errno != ENODEV)
+ ret = errno;
+ }
}
/* Check if one of the fcntl calls failed: */
OpenPOWER on IntegriCloud