From: root Date: Sun, 2 Jun 1996 18:05:36 +0000 (+0000) Subject: don't barf if we can't canonicalize the hostname X-Git-Tag: rpm-4.4-release~5136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d7219af102c0c59136f96e3b0891b3c11eaedb0;p=platform%2Fupstream%2Frpm.git don't barf if we can't canonicalize the hostname CVS patchset: 599 CVS date: 1996/06/02 18:05:36 --- 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);