add some more ifdefs, so that we don't define variables we don't use.

This commit is contained in:
christos 2002-08-20 13:58:22 +00:00
parent 7d62d2a173
commit 9d7f515ba2
2 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_term.c,v 1.32 2002/08/20 13:12:00 christos Exp $ */
/* $NetBSD: sys_term.c,v 1.33 2002/08/20 13:58:22 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: sys_term.c,v 1.32 2002/08/20 13:12:00 christos Exp $");
__RCSID("$NetBSD: sys_term.c,v 1.33 2002/08/20 13:58:22 christos Exp $");
#endif
#endif /* not lint */
@ -62,6 +62,7 @@ struct utmpx wtmp;
struct utmp wtmp;
#endif /* UTMPX */
#if !defined(UTMPX) && !(defined(CRAY) || defined(__hpux)) && BSD <= 43
int utmp_len = sizeof(wtmp.ut_host);
#ifndef PARENT_DOES_UTMP
char wtmpf[] = "/usr/adm/wtmp";
@ -69,6 +70,7 @@ char utmpf[] = "/etc/utmp";
#else /* PARENT_DOES_UTMP */
char wtmpf[] = "/etc/wtmp";
#endif /* PARENT_DOES_UTMP */
#endif
#ifdef CRAY
#include <tmpdir.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: telnetd.c,v 1.32 2002/01/31 07:54:50 itojun Exp $ */
/* $NetBSD: telnetd.c,v 1.33 2002/08/20 13:58:22 christos Exp $ */
/*
* Copyright (C) 1997 and 1998 WIDE Project.
@ -69,7 +69,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: telnetd.c,v 1.32 2002/01/31 07:54:50 itojun Exp $");
__RCSID("$NetBSD: telnetd.c,v 1.33 2002/08/20 13:58:22 christos Exp $");
#endif
#endif /* not lint */
@ -131,7 +131,9 @@ int auth_level = 0;
int require_secure_login = 0;
#endif
#if !defined(UTMPX) && !(defined(CRAY) || defined(__hpux)) && BSD <= 43
extern int utmp_len;
#endif
extern int require_hwpreauth;
#ifdef KRB5
extern krb5_context telnet_context;
@ -435,7 +437,11 @@ main(argc, argv)
break;
case 'u':
#if !defined(UTMPX) && !(defined(CRAY) || defined(__hpux)) && BSD <= 43
utmp_len = atoi(optarg);
#else
fprintf(stderr, "telnetd: -u option unneeded\n");
#endif
break;
case 'U':
@ -928,9 +934,11 @@ doit(who)
error = getnameinfo(who, who->sa_len, remote_host_name,
sizeof(remote_host_name), NULL, 0, 0);
#if !defined(UTMPX) && !(defined(CRAY) || defined(__hpux)) && BSD <= 43
if (!error && strlen(remote_host_name) > utmp_len)
error = getnameinfo(who, who->sa_len, remote_host_name,
sizeof(remote_host_name), NULL, 0, NI_NUMERICHOST);
#endif
if (error) {
fatal(net, "Couldn't resolve your address into a host name.\r\n\