Commit c550e0e2 authored by stolz's avatar stolz
Browse files

[project @ 2003-10-21 11:51:15 by stolz]

Save one fcntl-call in setNonBlockingFd when Fd is already non-blocking.

Please merge.
parent 8449f6e5
/* -----------------------------------------------------------------------------
* $Id: RtsUtils.c,v 1.35 2003/08/22 22:24:16 sof Exp $
* $Id: RtsUtils.c,v 1.36 2003/10/21 11:51:15 stolz Exp $
*
* (c) The GHC Team, 1998-2002
*
......@@ -249,7 +249,9 @@ setNonBlockingFd(int fd)
/* clear the non-blocking flag on this file descriptor */
fd_flags = fcntl(fd, F_GETFL);
fcntl(fd, F_SETFL, fd_flags | O_NONBLOCK);
if (!(fd_flags & O_NONBLOCK)) {
fcntl(fd, F_SETFL, fd_flags | O_NONBLOCK);
}
}
#else
/* Stub defns -- async / non-blocking IO is not done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment