summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-01-06 22:12:46 +0000
committermarcel <marcel@FreeBSD.org>2006-01-06 22:12:46 +0000
commit691f012913351f4b70e5cada5223ee00906b4baa (patch)
tree3b56c123c505d246c296fca4bb6da880d61b4c18
parent33031923ec16ec9aa454446377691c53a956c474 (diff)
downloadFreeBSD-src-691f012913351f4b70e5cada5223ee00906b4baa.zip
FreeBSD-src-691f012913351f4b70e5cada5223ee00906b4baa.tar.gz
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
-rw-r--r--sys/sys/select.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/select.h b/sys/sys/select.h
index 342a849..511895b 100644
--- a/sys/sys/select.h
+++ b/sys/sys/select.h
@@ -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; \
OpenPOWER on IntegriCloud