summaryrefslogtreecommitdiffstats
path: root/libc/dns/net/getaddrinfo.c
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-03-18 12:07:00 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-03-18 12:07:00 +0100
commit385816ce486622d72a8e56443b53ff8404d4ae3b (patch)
treeeda6b439a633bda0fed55b9753ca9b035dc7c04d /libc/dns/net/getaddrinfo.c
parentd103a5984a13da8a540dd760e8682b6ac257e263 (diff)
parentf6164e6c266759ab0cd9e7e491326d3c0974dfbd (diff)
downloadbionic-385816ce486622d72a8e56443b53ff8404d4ae3b.zip
bionic-385816ce486622d72a8e56443b53ff8404d4ae3b.tar.gz
bionic-385816ce486622d72a8e56443b53ff8404d4ae3b.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_bionic into replicant-6.0replicant-6.0-alpha-0005replicant-6.0-alpha-0004
Diffstat (limited to 'libc/dns/net/getaddrinfo.c')
-rw-r--r--libc/dns/net/getaddrinfo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c
index 829b679..cc8b8b4 100644
--- a/libc/dns/net/getaddrinfo.c
+++ b/libc/dns/net/getaddrinfo.c
@@ -1791,10 +1791,14 @@ _find_src_addr(const struct sockaddr *addr, struct sockaddr *src_addr, unsigned
return -1;
}
}
- if (mark != MARK_UNSET && setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0)
+ if (mark != MARK_UNSET && setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0) {
+ close(sock);
return 0;
- if (uid > 0 && uid != NET_CONTEXT_INVALID_UID && fchown(sock, uid, (gid_t)-1) < 0)
+ }
+ if (uid > 0 && uid != NET_CONTEXT_INVALID_UID && fchown(sock, uid, (gid_t)-1) < 0) {
+ close(sock);
return 0;
+ }
do {
ret = __connect(sock, addr, len);
} while (ret == -1 && errno == EINTR);