From 2d7219af102c0c59136f96e3b0891b3c11eaedb0 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 2 Jun 1996 18:05:36 +0000 Subject: [PATCH] don't barf if we can't canonicalize the hostname CVS patchset: 599 CVS date: 1996/06/02 18:05:36 --- build/pack.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/pack.c b/build/pack.c index 5e094c1..29a4f87 100644 --- a/build/pack.c +++ b/build/pack.c @@ -1234,8 +1234,12 @@ static char *buildHost(void) if (! gotit) { gethostname(hostname, sizeof(hostname)); - hbn = gethostbyname(hostname); - strcpy(hostname, hbn->h_name); + if ((hbn = gethostbyname(hostname))) { + strcpy(hostname, hbn->h_name); + } else { + message(MESS_WARNING, "Could not canonicalize hostname: %s\n", + hostname); + } gotit = 1; } return(hostname); -- 2.7.4