Remove error check from call to set the file descriptor to non-blocking

instead of explicitly ignoring some errors. This allows for the case
where a device is naturally non-blocking.
This commit is contained in:
jb 1998-05-27 00:41:22 +00:00
parent 39799063ce
commit f5689a7c8a

View File

@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: uthread_fd.c,v 1.5 1998/02/13 01:27:32 julian Exp $
* $Id: uthread_fd.c,v 1.6 1998/04/29 09:58:46 jb Exp $
*
*/
#include <errno.h>
@ -115,17 +115,14 @@ _thread_fd_table_init(int fd)
_thread_fd_table[fd]->flags =
_pthread_stdio_flags[fd];
/* Make the file descriptor non-blocking: */
if (_thread_sys_fcntl(fd, F_SETFL,
_thread_fd_table[fd]->flags | O_NONBLOCK) == -1) {
/*
* Some devices don't support
* non-blocking calls (sigh):
*/
if (errno != ENODEV) {
ret = -1;
}
}
/*
* Make the file descriptor non-blocking.
* This might fail if the device driver does
* not support non-blocking calls, or if the
* driver is naturally non-blocking.
*/
_thread_sys_fcntl(fd, F_SETFL,
_thread_fd_table[fd]->flags | O_NONBLOCK);
}
/* Check if one of the fcntl calls failed: */