Raise EAI_SYSTEM when pthread_create fails in getaddrinfo
Previously, EAI_AGAIN was raised. In our CI, "Temporary failure in name resolution" (EAI_AGAIN) is often raised. We are not sure if this was caused by pthread_create failure or getaddrinfo failure. To make it possible to distinguish between them, this changeset raises EAI_SYSTEM instead of EAI_AGAIN on pthread_create failure.
This commit is contained in:
parent
d05d03b186
commit
b346eb8f14
@ -493,8 +493,10 @@ start:
|
||||
|
||||
pthread_t th;
|
||||
if (do_pthread_create(&th, do_getaddrinfo, arg) != 0) {
|
||||
int err = errno;
|
||||
free_getaddrinfo_arg(arg);
|
||||
return EAI_AGAIN;
|
||||
errno = err;
|
||||
return EAI_SYSTEM;
|
||||
}
|
||||
pthread_detach(th);
|
||||
|
||||
@ -712,8 +714,10 @@ start:
|
||||
|
||||
pthread_t th;
|
||||
if (do_pthread_create(&th, do_getnameinfo, arg) != 0) {
|
||||
int err = errno;
|
||||
free_getnameinfo_arg(arg);
|
||||
return EAI_AGAIN;
|
||||
errno = err;
|
||||
return EAI_SYSTEM;
|
||||
}
|
||||
pthread_detach(th);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user