MCPcopy Create free account
hub / github.com/RsyncProject/rsync / gai_strerror

Function gai_strerror

lib/getaddrinfo.c:340–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338
339
340const char *gai_strerror(int errcode)
341{
342#ifdef HAVE_HSTRERROR
343 int hcode;
344
345 switch (errcode)
346 {
347 case EAI_NONAME:
348 hcode = HOST_NOT_FOUND;
349 break;
350 case EAI_AGAIN:
351 hcode = TRY_AGAIN;
352 break;
353 case EAI_FAIL:
354 default:
355 hcode = NO_RECOVERY;
356 break;
357 }
358
359 return hstrerror(hcode);
360#else /* !HAVE_HSTRERROR */
361
362 switch (errcode)
363 {
364 case EAI_NONAME:
365 return "Unknown host";
366 case EAI_AGAIN:
367 return "Host name lookup failure";
368#ifdef EAI_BADFLAGS
369 case EAI_BADFLAGS:
370 return "Invalid argument";
371#endif
372#ifdef EAI_FAMILY
373 case EAI_FAMILY:
374 return "Address family not supported";
375#endif
376#ifdef EAI_MEMORY
377 case EAI_MEMORY:
378 return "Not enough memory";
379#endif
380#ifdef EAI_NODATA
381 case EAI_NODATA:
382 return "No host data of that type was found";
383#endif
384#ifdef EAI_SERVICE
385 case EAI_SERVICE:
386 return "Class type not found";
387#endif
388#ifdef EAI_SOCKTYPE
389 case EAI_SOCKTYPE:
390 return "Socket type not supported";
391#endif
392 default:
393 return "Unknown server error";
394 }
395#endif /* HAVE_HSTRERROR */
396}
397

Callers 6

try_bind_localFunction · 0.85
open_socket_outFunction · 0.85
open_socket_inFunction · 0.85
client_nameFunction · 0.85
check_nameFunction · 0.85
match_addressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected