[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Blocking/Non-Blocking Sockets and Daemons
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Blocking/Non-Blocking Sockets and Daemons
- From: Daniel Hartmeier <daniel_(_at_)_benzedrine_(_dot_)_cx>
- Date: Wed, 21 Nov 2001 21:29:43 +0100
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
Visit your host, monkey.org