OSDN Git Service

Fix SOCK_* flag definitions
authorGreg Hackmann <ghackmann@google.com>
Wed, 26 Aug 2015 00:45:46 +0000 (17:45 -0700)
committerGreg Hackmann <ghackmann@google.com>
Fri, 18 Sep 2015 20:37:53 +0000 (13:37 -0700)
MIPS and the rest of the world only disagree on the first two SOCK_*
constants, so restructure the #ifdef accordingly.

As a deliberate side effect, this fixes SOCK_DCCP being missing on
non-MIPS platforms.

Change-Id: I2267008f1121a7eebe1ed9097afab6e612bce7f0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
libc/include/sys/socket.h

index ff8a815..c0720b8 100644 (file)
@@ -50,19 +50,15 @@ struct timespec;
 #ifdef __mips__
 #define SOCK_DGRAM      1
 #define SOCK_STREAM     2
+#else
+#define SOCK_STREAM     1
+#define SOCK_DGRAM      2
+#endif
 #define SOCK_RAW        3
 #define SOCK_RDM        4
 #define SOCK_SEQPACKET  5
 #define SOCK_DCCP       6
 #define SOCK_PACKET     10
-#else
-#define SOCK_STREAM      1
-#define SOCK_DGRAM       2
-#define SOCK_RAW         3
-#define SOCK_RDM         4
-#define SOCK_SEQPACKET   5
-#define SOCK_PACKET      10
-#endif
 
 #define SOCK_CLOEXEC O_CLOEXEC
 #define SOCK_NONBLOCK O_NONBLOCK