don't barf if we can't canonicalize the hostname
authorroot <devnull@localhost>
Sun, 2 Jun 1996 18:05:36 +0000 (18:05 +0000)
committerroot <devnull@localhost>
Sun, 2 Jun 1996 18:05:36 +0000 (18:05 +0000)
CVS patchset: 599
CVS date: 1996/06/02 18:05:36

build/pack.c

index 5e094c1..29a4f87 100644 (file)
@@ -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);