From 355f984dc8b718288711f8d61415c67e8973d773 Mon Sep 17 00:00:00 2001 From: danw Date: Mon, 5 Jan 1998 14:54:47 +0000 Subject: [PATCH] assume POSIX (uname vs gethostname) --- lib/fixhost.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/fixhost.c b/lib/fixhost.c index d712d6eb..d794157f 100644 --- a/lib/fixhost.c +++ b/lib/fixhost.c @@ -19,9 +19,7 @@ static char *rcsid_fixhost_c = "$Header$"; #include #include #include -#ifdef POSIX #include -#endif #include #include #include @@ -45,9 +43,7 @@ canonicalize_hostname(host) int n_len; int has_dot = 0; char tbuf[BUFSIZ]; -#ifdef POSIX struct utsname name; -#endif register char *cp; if (strlen(host) > 2 && host[0] == '"' && host[strlen(host)-1] == '"') { @@ -79,13 +75,8 @@ canonicalize_hostname(host) static char *domain = NULL; if (domain == NULL) { -#ifdef POSIX (void) uname(&name); - strncpy(tbuf, name.nodename, sizeof(tbuf)); -#else - gethostname(tbuf, sizeof(tbuf)); -#endif - hp = gethostbyname(tbuf); + hp = gethostbyname(name.nodename); cp = strchr(hp->h_name, '.'); if (cp) domain = strsave(++cp); -- 2.45.2