diff --git a/appl/telnet/telnetd/telnetd.c b/appl/telnet/telnetd/telnetd.c index 79c42d053..aa33d09f4 100644 --- a/appl/telnet/telnetd/telnetd.c +++ b/appl/telnet/telnetd/telnetd.c @@ -410,7 +410,7 @@ int main(int argc, char **argv) roken_openlog("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON); fromlen = sizeof (from); - if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) { + if (getpeername(STDIN_FILENO, (struct sockaddr *)&from, &fromlen) < 0) { fprintf(stderr, "%s: ", progname); perror("getpeername"); _exit(1); @@ -715,10 +715,6 @@ Please contact your net administrator"); gethostname(host_name, sizeof (host_name)); hostname = host_name; -#ifndef abs -#define abs(x) ((x < 0) ? (-x) : x) -#endif - /* Only trim if too long (and possible) */ if (strlen(remote_host_name) > abs(utmp_len)) { char *domain = strchr(host_name, '.');