#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
-#ifdef POSIX
#include <sys/utsname.h>
-#endif
#include <string.h>
#include <ctype.h>
#include <moira.h>
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] == '"') {
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);