summaryrefslogtreecommitdiff
path: root/build/pack.c
diff options
context:
space:
mode:
authorroot <devnull@localhost>1996-06-02 18:05:36 +0000
committerroot <devnull@localhost>1996-06-02 18:05:36 +0000
commit2d7219af102c0c59136f96e3b0891b3c11eaedb0 (patch)
treecd697548f0289d24e3774e6e7841cec3cda9b1cd /build/pack.c
parent6e459f800208f04cbfb4e74434bc33545b592779 (diff)
downloadrpm-2d7219af102c0c59136f96e3b0891b3c11eaedb0.tar.gz
rpm-2d7219af102c0c59136f96e3b0891b3c11eaedb0.tar.bz2
rpm-2d7219af102c0c59136f96e3b0891b3c11eaedb0.zip
don't barf if we can't canonicalize the hostname
CVS patchset: 599 CVS date: 1996/06/02 18:05:36
Diffstat (limited to 'build/pack.c')
-rw-r--r--build/pack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/pack.c b/build/pack.c
index 5e094c1e6..29a4f87a6 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);