(krb5_eai_to_heim_errno): add `errno' (called system_error) to allow
callers to make sure they pass the current and relevant value git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9950 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2001 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 2000 - 2001 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -35,8 +35,14 @@
|
|||||||
|
|
||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* convert the getaddrinfo error code in `eai_errno' into a
|
||||||
|
* krb5_error_code. `system_error' should have the value of the errno
|
||||||
|
* after the failed call.
|
||||||
|
*/
|
||||||
|
|
||||||
krb5_error_code
|
krb5_error_code
|
||||||
krb5_eai_to_heim_errno(int eai_errno)
|
krb5_eai_to_heim_errno(int eai_errno, int system_error)
|
||||||
{
|
{
|
||||||
switch(eai_errno) {
|
switch(eai_errno) {
|
||||||
case EAI_NOERROR:
|
case EAI_NOERROR:
|
||||||
@@ -62,7 +68,7 @@ krb5_eai_to_heim_errno(int eai_errno)
|
|||||||
case EAI_SOCKTYPE:
|
case EAI_SOCKTYPE:
|
||||||
return HEIM_EAI_SOCKTYPE;
|
return HEIM_EAI_SOCKTYPE;
|
||||||
case EAI_SYSTEM:
|
case EAI_SYSTEM:
|
||||||
return errno;
|
return system_error;
|
||||||
default:
|
default:
|
||||||
return HEIM_EAI_UNKNOWN; /* XXX */
|
return HEIM_EAI_UNKNOWN; /* XXX */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user