Imported Upstream version 0.2.5
[platform/upstream/libtirpc.git] / src / rpc_generic.c
index 509fb36..a43906c 100644 (file)
@@ -228,16 +228,16 @@ __rpc_getconfip(nettype)
        extern thread_key_t tcp_key, udp_key;
        extern mutex_t tsd_lock;
 
-       if (tcp_key == -1) {
+       if (tcp_key == KEY_INITIALIZER) {
                mutex_lock(&tsd_lock);
-               if (tcp_key == -1)
+               if (tcp_key == KEY_INITIALIZER)
                        thr_keycreate(&tcp_key, free);
                mutex_unlock(&tsd_lock);
        }
        netid_tcp = (char *)thr_getspecific(tcp_key);
-       if (udp_key == -1) {
+       if (udp_key == KEY_INITIALIZER) {
                mutex_lock(&tsd_lock);
-               if (udp_key == -1)
+               if (udp_key == KEY_INITIALIZER)
                        thr_keycreate(&udp_key, free);
                mutex_unlock(&tsd_lock);
        }
@@ -535,7 +535,9 @@ __rpc_nconf2fd_flags(const struct netconfig *nconf, int flags)
            si.si_af == AF_INET6) {
                int val = 1;
 
+#ifdef INET6
                setsockopt(fd, SOL_IPV6, IPV6_V6ONLY, &val, sizeof(val));
+#endif
        }
        return fd;
 }