From: Ezra Peisach Date: Mon, 26 Jun 2000 23:24:38 +0000 (+0000) Subject: * libpty.h: If SOCK_DGRAM is not defined, provide a definition for X-Git-Tag: krb5-1.3-alpha1~2088 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=635f9670e2c6907b58ca1756f8f2ddd3b6b11cf8;p=krb5.git * libpty.h: If SOCK_DGRAM is not defined, provide a definition for struct sockaddr_in to satisfy prototype. (based on similar code in k5-int.h). * update_wtmp.c (ptyint_update_wtmp), update_utmp.c (pty_update_utmp), open_slave.c (pty_open_slave), getpty.c (pty_getpty): conditionalize definition of variables based on code paths that are included. Essentially, clean up many compiler warnings. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12438 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index de572707b..df5ef643c 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,16 @@ +2000-06-26 Ezra Peisach + + * libpty.h: If SOCK_DGRAM is not defined, provide a definition for + struct sockaddr_in to satisfy prototype. (based on similar + code in k5-int.h). + + * update_wtmp.c (ptyint_update_wtmp), update_utmp.c + (pty_update_utmp), open_slave.c (pty_open_slave), getpty.c + (pty_getpty): conditionalize definition of variables based on code + paths that are included. + + + 1999-10-26 Tom Yu * configure.in: Check for alpha*-dec-osf* instead of diff --git a/src/util/pty/getpty.c b/src/util/pty/getpty.c index 3683ba641..7d8614038 100644 --- a/src/util/pty/getpty.c +++ b/src/util/pty/getpty.c @@ -28,11 +28,14 @@ long pty_getpty (fd, slave, slavelength) int slavelength; int *fd; char *slave; { +#if !defined(HAVE__GETPTY) char *cp; char *p; int i,ptynum; struct stat stb; char slavebuf[1024]; +#endif + #ifdef HAVE__GETPTY char *slaveret; /*Temporary to hold pointer to slave*/ #endif /*HAVE__GETPTY*/ diff --git a/src/util/pty/libpty.h b/src/util/pty/libpty.h index 82d2d81cc..5fccf016d 100644 --- a/src/util/pty/libpty.h +++ b/src/util/pty/libpty.h @@ -44,6 +44,11 @@ long pty_update_utmp (int process_type,int pid, char *user, char *line, char *h long pty_logwtmp (char *tty, char * user, char *host); long pty_cleanup(char *slave, int pid, int update_utmp); + +#ifndef SOCK_DGRAM +struct sockaddr_in; +#endif + long pty_make_sane_hostname(struct sockaddr_in *, int, int, int, char **); #else /*__STDC__*/ long pty_init(); diff --git a/src/util/pty/open_slave.c b/src/util/pty/open_slave.c index aea04de1f..b8c332603 100644 --- a/src/util/pty/open_slave.c +++ b/src/util/pty/open_slave.c @@ -29,7 +29,11 @@ long pty_open_slave ( slave, fd) const char *slave; int *fd; { - int vfd, testfd; +#ifdef VHANG_FIRST + int vfd; +#endif + + int testfd; long retval; #ifdef POSIX_SIGNALS struct sigaction sa; diff --git a/src/util/pty/update_utmp.c b/src/util/pty/update_utmp.c index 0c089d6d4..173e3e2dd 100644 --- a/src/util/pty/update_utmp.c +++ b/src/util/pty/update_utmp.c @@ -44,7 +44,7 @@ long pty_update_utmp (process_type, pid, username, line, host, flags) struct utmp ent, ut; #ifndef HAVE_SETUTENT struct stat statb; - int tty; + int tty, fd; #endif #ifdef HAVE_SETUTXENT struct utmpx utx; @@ -54,7 +54,6 @@ long pty_update_utmp (process_type, pid, username, line, host, flags) char utmp_id[5]; #endif char userbuf[32]; - int fd; strncpy(ent.ut_line, line+sizeof("/dev/")-1, sizeof(ent.ut_line)); ent.ut_time = time(0); diff --git a/src/util/pty/update_wtmp.c b/src/util/pty/update_wtmp.c index 7e8d57303..cd714687c 100644 --- a/src/util/pty/update_wtmp.c +++ b/src/util/pty/update_wtmp.c @@ -50,10 +50,13 @@ long ptyint_update_wtmp (ent , host, user) char *host; char *user; { - struct utmp ut; - struct stat statb; +#ifndef HAVE_UPDWTMP int fd; time_t uttime; + struct utmp ut; + struct stat statb; +#endif + #ifdef HAVE_UPDWTMPX struct utmpx utx; @@ -69,7 +72,7 @@ long ptyint_update_wtmp (ent , host, user) #ifdef HAVE_UPDWTMP #ifndef HAVE_UPDWTMPX -/* This is already performed byupdwtmpx if present.*/ +/* This is already performed by updwtmpx if present.*/ updwtmp(WTMP_FILE, ent); #endif /* HAVE_UPDWTMPX*/ #else /* HAVE_UPDWTMP */