OSDN Git Service

Break two incorrect transitive includes.
authorElliott Hughes <enh@google.com>
Thu, 29 Jan 2015 05:02:34 +0000 (21:02 -0800)
committerElliott Hughes <enh@google.com>
Fri, 30 Jan 2015 04:12:13 +0000 (20:12 -0800)
Change-Id: I95519caa5258cf5c6b8053f1c7e08ade2a824e49

libc/include/string.h
libc/include/sys/select.h

index 4ca77ae..d67928c 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <sys/cdefs.h>
 #include <stddef.h>
-#include <malloc.h>
 #include <xlocale.h>
 
 __BEGIN_DECLS
index 553050b..0c4a823 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <linux/time.h>
 #include <signal.h>
-#include <string.h>
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
@@ -49,7 +48,14 @@ typedef struct {
 #define __FDMASK(fd) (1UL << ((fd) % NFDBITS))
 #define __FDS_BITS(set) (((fd_set*)(set))->fds_bits)
 
-#define FD_ZERO(set) (memset(set, 0, sizeof(*(fd_set*)(set))))
+/* Inline loop so we don't have to declare memset. */
+#define FD_ZERO(set) \
+  do { \
+    size_t __i; \
+    for (__i = 0; __i < __FDSET_LONGS; ++__i) { \
+      (set)->fds_bits[__i] = 0; \
+    } \
+  } while (0)
 
 extern void __FD_CLR_chk(int, fd_set*, size_t);
 extern void __FD_SET_chk(int, fd_set*, size_t);