From 5fc2c035953f71992197f6025918a8fe79ade1d3 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 23 Apr 2012 10:49:47 +0100 Subject: win32: use uname/getdomainname in safe_gethostname.c --- libbb/safe_gethostname.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'libbb') diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c index 16c966e58..bdb989631 100644 --- a/libbb/safe_gethostname.c +++ b/libbb/safe_gethostname.c @@ -35,7 +35,6 @@ */ char* FAST_FUNC safe_gethostname(void) { -#if !ENABLE_PLATFORM_MINGW32 struct utsname uts; /* The length of the arrays in a struct utsname is unspecified; @@ -50,13 +49,6 @@ char* FAST_FUNC safe_gethostname(void) /* Uname can fail only if you pass a bad pointer to it. */ uname(&uts); return xstrndup(!uts.nodename[0] ? "?" : uts.nodename, sizeof(uts.nodename)); -#else - /* We really don't care about people with host names wider than most screens */ - char buf[256]; - int r = gethostname(buf, sizeof(buf)); - buf[sizeof(buf)-1] = '\0'; - return xstrdup(r < 0 ? "?" : buf); -#endif } /* @@ -72,8 +64,6 @@ char* FAST_FUNC safe_getdomainname(void) struct utsname uts; uname(&uts); return xstrndup(!uts.domainname[0] ? "?" : uts.domainname, sizeof(uts.domainname)); -#elif ENABLE_PLATFORM_MINGW32 - return xstrdup("?"); #else /* We really don't care about people with domain names wider than most screens */ char buf[256]; -- cgit v1.2.3-55-g6feb