diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index 2b3ec3a6b588ff..909c02752c49eb 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -510,7 +510,7 @@ rb_getaddrinfo(const char *hostp, const char *portp, const struct addrinfo *hint if (err == 0) *ai = arg->ai; } else if (arg->cancelled) { - err = EAI_AGAIN; + retry = 1; } else { // If already interrupted, rb_thread_call_without_gvl2 may return without calling wait_getaddrinfo. @@ -731,7 +731,7 @@ rb_getnameinfo(const struct sockaddr *sa, socklen_t salen, } } else if (arg->cancelled) { - err = EAI_AGAIN; + retry = 1; } else { // If already interrupted, rb_thread_call_without_gvl2 may return without calling wait_getnameinfo.