summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2000-06-26 23:24:38 +0000
committerEzra Peisach <epeisach@mit.edu>2000-06-26 23:24:38 +0000
commit635f9670e2c6907b58ca1756f8f2ddd3b6b11cf8 (patch)
treef5e877c24c3cd44c449a937d200de0f6d0e4172e /src/util
parent76fb3fad615c41a5e5edde4c358e67750d4ee7c5 (diff)
downloadkrb5-635f9670e2c6907b58ca1756f8f2ddd3b6b11cf8.tar.gz
krb5-635f9670e2c6907b58ca1756f8f2ddd3b6b11cf8.tar.xz
krb5-635f9670e2c6907b58ca1756f8f2ddd3b6b11cf8.zip
* 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
Diffstat (limited to 'src/util')
-rw-r--r--src/util/pty/ChangeLog13
-rw-r--r--src/util/pty/getpty.c3
-rw-r--r--src/util/pty/libpty.h5
-rw-r--r--src/util/pty/open_slave.c6
-rw-r--r--src/util/pty/update_utmp.c3
-rw-r--r--src/util/pty/update_wtmp.c9
6 files changed, 33 insertions, 6 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index de572707be..df5ef643cf 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,3 +1,16 @@
+2000-06-26 Ezra Peisach <epeisach@mit.edu>
+
+ * 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 <tlyu@mit.edu>
* configure.in: Check for alpha*-dec-osf* instead of
diff --git a/src/util/pty/getpty.c b/src/util/pty/getpty.c
index 3683ba6410..7d86140386 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 82d2d81cc3..5fccf016df 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 aea04de1fb..b8c3326032 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 0c089d6d40..173e3e2dd0 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 7e8d57303f..cd714687c4 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 */