From e5ad73103fa95089c325ea12888572bfb3117981 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Mon, 14 May 2001 22:48:33 +0000 Subject: [PATCH] (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 --- lib/krb5/eai_to_heim_errno.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/krb5/eai_to_heim_errno.c b/lib/krb5/eai_to_heim_errno.c index 7aad3a7b0..06cf602b5 100644 --- a/lib/krb5/eai_to_heim_errno.c +++ b/lib/krb5/eai_to_heim_errno.c @@ -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). * All rights reserved. * @@ -35,8 +35,14 @@ 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_eai_to_heim_errno(int eai_errno) +krb5_eai_to_heim_errno(int eai_errno, int system_error) { switch(eai_errno) { case EAI_NOERROR: @@ -62,7 +68,7 @@ krb5_eai_to_heim_errno(int eai_errno) case EAI_SOCKTYPE: return HEIM_EAI_SOCKTYPE; case EAI_SYSTEM: - return errno; + return system_error; default: return HEIM_EAI_UNKNOWN; /* XXX */ }