[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Blocking/Non-Blocking Sockets and Daemons



On Wed, Nov 21, 2001 at 11:17:16AM -0800, Randall Gellens wrote:

>              rslt = fcntl ( newsockfd, F_SETFL, fd_flags - O_NONBLOCK );

That's not the right way to clear a bit, as you seem to assume. Imagine
fd_flags == 8 and O_NONBLOCK == 4. Try this instead:

  fd_flags & ~O_NONBLOCK

Daniel