diff --git a/nsprpub/pr/src/io/prsocket.c b/nsprpub/pr/src/io/prsocket.c index 6d56339fc99..644a2470a5d 100644 --- a/nsprpub/pr/src/io/prsocket.c +++ b/nsprpub/pr/src/io/prsocket.c @@ -1254,22 +1254,16 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto) return NULL; } -#if defined(_PR_INET6) - if (PR_AF_INET6 == domain) { #if defined(_PR_INET6_PROBE) - if (_pr_ipv6_is_present == PR_FALSE) - domain = AF_INET; - else -#endif - domain = AF_INET6; - } -#elif defined(_PR_INET6_PROBE) if (PR_AF_INET6 == domain) { if (_pr_ipv6_is_present == PR_FALSE) domain = AF_INET; else domain = AF_INET6; } +#elif defined(_PR_INET6) + if (PR_AF_INET6 == domain) + domain = AF_INET6; #else if (PR_AF_INET6 == domain) domain = AF_INET; @@ -1287,7 +1281,7 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto) */ if (fd != NULL) { _PR_MD_MAKE_NONBLOCK(fd); -#if !defined(_PR_INET6) || defined(_PR_INET6_PROBE) +#if defined(_PR_INET6_PROBE) || !defined(_PR_INET6) /* * For platforms with no support for IPv6 * create layered socket for IPv4-mapped IPv6 addresses diff --git a/nsprpub/pr/src/pthreads/ptio.c b/nsprpub/pr/src/pthreads/ptio.c index 7a16516b8f1..519b76d4dde 100644 --- a/nsprpub/pr/src/pthreads/ptio.c +++ b/nsprpub/pr/src/pthreads/ptio.c @@ -2833,22 +2833,16 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto) (void)PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0); return fd; } -#if defined(_PR_INET6) - if (PR_AF_INET6 == domain) { #if defined(_PR_INET6_PROBE) - if (_pr_ipv6_is_present == PR_FALSE) - domain = AF_INET; - else -#endif - domain = AF_INET6; - } -#elif defined(_PR_INET6_PROBE) if (PR_AF_INET6 == domain) { if (_pr_ipv6_is_present == PR_FALSE) domain = AF_INET; else domain = AF_INET6; } +#elif defined(_PR_INET6) + if (PR_AF_INET6 == domain) + domain = AF_INET6; #else if (PR_AF_INET6 == domain) domain = AF_INET; @@ -2861,7 +2855,7 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto) fd = pt_SetMethods(osfd, ftype, PR_FALSE); if (fd == NULL) close(osfd); } -#if !defined(_PR_INET6) || defined(_PR_INET6_PROBE) +#if defined(_PR_INET6_PROBE) || !defined(_PR_INET6) if (fd != NULL) { /* * For platforms with no support for IPv6