From: Ezra Peisach Date: Thu, 3 May 2001 18:41:20 +0000 (+0000) Subject: * cleanup.c (pty_cleanup): Delcare local variable only if X-Git-Tag: krb5-1.3-alpha1~1524 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e8e5b4c5a41dd22e6fffcf07665769044a8eae7;p=krb5.git * cleanup.c (pty_cleanup): Delcare local variable only if VHANG_LAST defined. * logwtmp.c (pty_logwtmp): Only declare local variables if logwtmp() not available on system. * sane_hostname.c (sockaddrlen): Only define static function if HAVE_GETNAMEINFO defined. (pty_make_sane_hostname) Declare goto target only if code compiled in. gcc warning cleanups git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13227 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index 90a0a1ef4..a3794f784 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,15 @@ +2001-05-03 Ezra Peisach + + * cleanup.c (pty_cleanup): Delcare local variable only if + VHANG_LAST defined. + + * logwtmp.c (pty_logwtmp): Only declare local variables if + logwtmp() not available on system. + + * sane_hostname.c (sockaddrlen): Only define static function if + HAVE_GETNAMEINFO defined. (pty_make_sane_hostname) Declare goto + target only if code compiled in. + 2001-05-01 Ken Raeburn * update_utmp.c (pty_update_utmp): Fix typo (OWRONLY -> diff --git a/src/util/pty/cleanup.c b/src/util/pty/cleanup.c index 32384108b..23db2a2f3 100644 --- a/src/util/pty/cleanup.c +++ b/src/util/pty/cleanup.c @@ -32,7 +32,9 @@ long pty_cleanup (slave, pid, update_utmp) int pid; /* May be zero for unknown.*/ int update_utmp; { +#ifdef VHANG_LAST int retval, fd; +#endif if (update_utmp) pty_update_utmp(PTY_DEAD_PROCESS,0, "", slave, (char *)0, PTY_UTMP_USERNAME_VALID); diff --git a/src/util/pty/logwtmp.c b/src/util/pty/logwtmp.c index 684033ed2..5b10f4616 100644 --- a/src/util/pty/logwtmp.c +++ b/src/util/pty/logwtmp.c @@ -33,11 +33,13 @@ long pty_logwtmp(const char *tty, const char *user, const char *host) { +#ifndef HAVE_LOGWTMP PTY_STRUCT_UTMPX utx; int loggingin; size_t len; const char *cp; char utmp_id[5]; +#endif #ifdef HAVE_LOGWTMP logwtmp(tty,user,host); diff --git a/src/util/pty/sane_hostname.c b/src/util/pty/sane_hostname.c index 753683ccc..5edd443ca 100644 --- a/src/util/pty/sane_hostname.c +++ b/src/util/pty/sane_hostname.c @@ -26,6 +26,7 @@ #include "libpty.h" #include +#ifdef HAVE_GETNAMEINFO static size_t sockaddrlen (const struct sockaddr *addr) { @@ -42,12 +43,13 @@ sockaddrlen (const struct sockaddr *addr) return 0; #endif } +#endif static void downcase (char *s) { for (; *s != '\0'; s++) - *s = tolower (*s); + *s = tolower ((int) *s); } static long @@ -106,7 +108,9 @@ pty_make_sane_hostname(const struct sockaddr *addr, int maxlen, return ENOMEM; if (always_ipaddr) +#ifdef HAVE_GETNAMEINFO use_ipaddr: +#endif return do_ntoa(addr, ut_host_len, out); #ifdef HAVE_GETNAMEINFO