Lines Matching refs:hostname
42 shrink_hostname (const char *hostname, in shrink_hostname() argument
50 if (strlen(hostname) < dst_sz) { in shrink_hostname()
51 strlcpy (dst, hostname, dst_sz); in shrink_hostname()
55 hd = strchr (hostname, '.'); in shrink_hostname()
58 && hd - hostname < dst_sz) { in shrink_hostname()
59 strlcpy (dst, hostname, dst_sz); in shrink_hostname()
60 dst[hd - hostname] = '\0'; in shrink_hostname()
64 ret = getaddrinfo (hostname, NULL, NULL, &ai); in shrink_hostname()
66 strncpy (dst, hostname, dst_sz); in shrink_hostname()
75 strncpy (dst, hostname, dst_sz); in shrink_hostname()
86 const char *username, const char *hostname) in prepare_utmp() argument
100 if (hostname[0]) { in prepare_utmp()
102 if ((he = gethostbyname(hostname))) in prepare_utmp()
109 shrink_hostname (hostname, utmp->ut_host, sizeof(utmp->ut_host)); in prepare_utmp()
127 void utmp_login(char *tty, const char *username, const char *hostname) in utmp_login() argument
133 void utmp_login(char *tty, const char *username, const char *hostname) in utmp_login() argument
138 prepare_utmp (&utmp, tty, username, hostname); in utmp_login()