$NetBSD: patch-ai,v 1.2 2005/05/29 14:38:33 wiz Exp $ --- glunix/src/util/cutil.cc.orig 1997-09-05 21:30:13.000000000 +0200 +++ glunix/src/util/cutil.cc @@ -82,7 +82,11 @@ #define __THIS_MODULE MODULE_UTIL #include +#ifndef __NetBSD__ #include +#else +#include +#endif #include #include @@ -137,11 +141,17 @@ Util_GetMyHostName(void) if (init) { return hostname; } - +#ifdef __NetBSD__ + if (gethostname(hostname,sizeof(hostname)-1) < 0) { + DE("Hostname: %s\n",strerror(errno)); + return NULL; + } +#else if (sysinfo(SI_HOSTNAME, hostname, sizeof(hostname)-1) < 0) { DE("sysinfo(SI_HOSTNAME): %s\n", strerror(errno)); return NULL; } +#endif init = True; return hostname; }