Fix FD_ISSET() on LP64 platforms. The FD_ISSET() function/macro is

defined to return an int, but on LP64 platforms the return value of
FD_ISSET() for file descriptors with a bit-index larger than 31 would
not fit an int (due to __fd_mask being defined as an unsigned long).
The fix is to explicitly test against 0.

PR: ia64/91421
Submitted by: Tanaka Akira (akr at m17n dot org)
MFC after: 1 week
This commit is contained in:
Marcel Moolenaar 2006-01-06 22:12:46 +00:00
parent a96727f36e
commit 6d85ea7820

View File

@ -80,7 +80,7 @@ typedef struct fd_set {
#if __BSD_VISIBLE
#define FD_COPY(f, t) (void)(*(t) = *(f))
#endif
#define FD_ISSET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n))
#define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0)
#define FD_SET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] |= __fdset_mask(n))
#define FD_ZERO(p) do { \
fd_set *_p; \