|
@@ -25,19 +25,19 @@
|
|
|
#include <features.h>
|
|
|
#include <libc-internal.h>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
ioctl calls to talk to the kernel. */
|
|
|
int __opensock(void) attribute_hidden;
|
|
|
int
|
|
|
-__opensock (void)
|
|
|
+__opensock(void)
|
|
|
{
|
|
|
- int fd;
|
|
|
+ int fd = -1;
|
|
|
#ifdef __UCLIBC_HAS_IPV6__
|
|
|
- fd = socket(AF_INET6, SOCK_DGRAM, 0);
|
|
|
- if (fd<0)
|
|
|
-#endif
|
|
|
- fd = socket(AF_INET, SOCK_DGRAM, 0);
|
|
|
- return(fd);
|
|
|
+ fd = socket(AF_INET6, SOCK_DGRAM, 0);
|
|
|
+#endif
|
|
|
+#ifdef __UCLIBC_HAS_IPV4__
|
|
|
+ if (fd < 0)
|
|
|
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
|
|
|
+#endif
|
|
|
+ return fd;
|
|
|
}
|