]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
h8300/m68k/xtensa: __FD_ISSET should return 0/1
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 26 Jul 2011 23:08:35 +0000 (16:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 23:49:43 +0000 (16:49 -0700)
Harmonise these return values with other architectures.  In some cases
this affects all compilers and in other cases non-gcc compilers only.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Ulrich Drepper <drepper@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/h8300/include/asm/posix_types.h
arch/m68k/include/asm/posix_types.h
arch/xtensa/include/asm/posix_types.h

index 5c553927fc538ae149426cb38f327a213d031141..6f833a16f694ca36383b5216b726966b35633766 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
 #define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
 
 #undef __FD_ISSET
-#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+#define        __FD_ISSET(d, set)      (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
 
 #undef __FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
index 63cdcc142d9357bc93c7210945d9080616176944..98d0970d9badf054e056820818ed7e0e29ba01b1 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 #define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
 
 #undef __FD_ISSET
-#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+#define        __FD_ISSET(d, set)      (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
 
 #undef __FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
index 43f9dd1126a41be1bac284085906debf1ab34b3b..6b2190c3588287446e66edd4bdf1803c17d298f1 100644 (file)
@@ -58,7 +58,7 @@ typedef struct {
 
 #define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
 #define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
-#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+#define        __FD_ISSET(d, set)      (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
 #define        __FD_ZERO(set)  \
   ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))