From 09c774418a04a607a315a54ba90faeded9a9d84f Mon Sep 17 00:00:00 2001 From: skarg Date: Wed, 4 Apr 2007 12:42:08 +0000 Subject: [PATCH] Added improved debug for Win32 BIP init (CN) --- bacnet-stack/ports/win32/bip-init.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bacnet-stack/ports/win32/bip-init.c b/bacnet-stack/ports/win32/bip-init.c index cf34a450..b509cb60 100644 --- a/bacnet-stack/ports/win32/bip-init.c +++ b/bacnet-stack/ports/win32/bip-init.c @@ -51,11 +51,16 @@ static long gethostaddr(void) if (gethostname(host_name, sizeof(host_name)) != 0) return -1; -#ifdef BIP_DEBUG - printf("host name: %s\n", host_name); -#endif + if ((host_ent = gethostbyname(host_name)) == NULL) return -1; +#ifdef BIP_DEBUG + printf("host: %s at %03u.%03u.%03u.%03u\n", host_name, + ((uint8_t*)host_ent->h_addr)[0], + ((uint8_t*)host_ent->h_addr)[1], + ((uint8_t*)host_ent->h_addr)[2], + ((uint8_t*)host_ent->h_addr)[3]); +#endif return *(long *) host_ent->h_addr; }