mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 04:13:39 +00:00
Use _close() instead of close() in addrconfig() to keep it from becoming a
potential cancellation point in libc_r.
This commit is contained in:
parent
941b8e0799
commit
61e4108c41
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63704
@ -1146,18 +1146,18 @@ addrconfig(pai)
|
||||
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
|
||||
af = AF_INET;
|
||||
else {
|
||||
close(s);
|
||||
_close(s);
|
||||
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
|
||||
af = AF_INET6;
|
||||
else
|
||||
close(s);
|
||||
_close(s);
|
||||
}
|
||||
|
||||
}
|
||||
if (af != AF_UNSPEC) {
|
||||
if ((s = socket(af, SOCK_DGRAM, 0)) < 0)
|
||||
return 0;
|
||||
close(s);
|
||||
_close(s);
|
||||
}
|
||||
pai->ai_family = af;
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user