From f7b3eeea03adf58e3f9e734320f38d4ae3581dfd Mon Sep 17 00:00:00 2001 From: Danilo Almeida Date: Thu, 11 Apr 2002 03:17:22 +0000 Subject: [PATCH] * locate_kdc.c (translate_ai_error), hst_realm.c (krb5int_translate_gai_error): Test some EAI_ error definitions so that we will also build correctly on Win32 (Winsock 2). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14377 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 6 ++++++ src/lib/krb5/os/hst_realm.c | 6 ++++++ src/lib/krb5/os/locate_kdc.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 771357e42..38f0f16f7 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,9 @@ +2002-04-10 Danilo Almeida + + * locate_kdc.c (translate_ai_error), hst_realm.c + (krb5int_translate_gai_error): Test some EAI_ error definitions + so that we will also build correctly on Win32 (Winsock 2). + 2002-03-26 Ken Raeburn * hostaddr.c (FAI_PREFIX): Delete. diff --git a/src/lib/krb5/os/hst_realm.c b/src/lib/krb5/os/hst_realm.c index fb81af2d3..4238f5e54 100644 --- a/src/lib/krb5/os/hst_realm.c +++ b/src/lib/krb5/os/hst_realm.c @@ -407,8 +407,10 @@ krb5_error_code krb5int_translate_gai_error (int num) { switch (num) { +#ifdef EAI_ADDRFAMILY case EAI_ADDRFAMILY: return EAFNOSUPPORT; +#endif case EAI_AGAIN: return EAGAIN; case EAI_BADFLAGS: @@ -419,16 +421,20 @@ krb5int_translate_gai_error (int num) return EAFNOSUPPORT; case EAI_MEMORY: return ENOMEM; +#if EAI_NODATA != EAI_NONAME case EAI_NODATA: return KRB5_EAI_NODATA; +#endif case EAI_NONAME: return KRB5_EAI_NONAME; case EAI_SERVICE: return KRB5_EAI_SERVICE; case EAI_SOCKTYPE: return EINVAL; +#ifdef EAI_SYSTEM case EAI_SYSTEM: return errno; +#endif } abort (); return -1; diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 4dc47cfb8..0395b7e99 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -214,7 +214,9 @@ static int translate_ai_error (int err) switch (err) { case 0: return 0; +#ifdef EAI_ADDRFAMILY case EAI_ADDRFAMILY: +#endif case EAI_BADFLAGS: case EAI_FAMILY: case EAI_SOCKTYPE: @@ -227,14 +229,18 @@ static int translate_ai_error (int err) case EAI_MEMORY: /* Translate to standard errno code. */ return ENOMEM; +#if EAI_NODATA != EAI_NONAME case EAI_NODATA: +#endif case EAI_NONAME: /* Name not known or no address data, but no error. Do nothing more. */ return 0; +#ifdef EAI_SYSTEM case EAI_SYSTEM: /* System error, obviously. */ return errno; +#endif default: /* An error code we haven't handled? */ return EINVAL; -- 2.26.2