(main): 0 -> STDIN_FILENO. remove abs

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5532 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-03-13 21:20:17 +00:00
parent b53d8f88b9
commit 80d58fee2e

View File

@@ -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, '.');