* logutil.c (update_wtmp): declare missing variables if
authorMark Eichin <eichin@mit.edu>
Wed, 11 Jan 1995 07:16:51 +0000 (07:16 +0000)
committerMark Eichin <eichin@mit.edu>
Wed, 11 Jan 1995 07:16:51 +0000 (07:16 +0000)
HAVE_SETUTENT isn't set.
(update_utmp): declare tty at top of function.

Now the whole tree builds under raw sunos, native cc (still needs gnumake
though)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4804 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/logutil.c

index fad183171b53baa0540008b216b266901259bc01..924f2e87ad29097f3d15b4077473bc6f4f8afd25 100644 (file)
@@ -1,3 +1,9 @@
+Wed Jan 11 01:25:09 1995  Mark Eichin  <eichin@cygnus.com>
+
+       * logutil.c (update_wtmp): declare missing variables if
+       HAVE_SETUTENT isn't set.
+       (update_utmp): declare tty at top of function.
+
 Tue Jan 10 19:43:18 1995  Mark Eichin  (eichin@cygnus.com)
 
        * krlogin.c (doit): use exit_handler for signal exits, don't use
index e069489ddadd5773bdd377af4d2cf270ea0ab62b..1f22083f2a99c402874087bb87a473ce0d933e3f 100644 (file)
@@ -55,6 +55,7 @@ void update_utmp(ent, username, line, host)
     struct utmp ut;
 #else
     struct stat statb;
+    int tty;
 #endif
 #ifdef HAVE_SETUTXENT
     struct utmpx utx;
@@ -124,7 +125,7 @@ void update_utmp(ent, username, line, host)
 
 #else /* HAVE_SETUTENT */
        
-    int tty = ttyslot();
+    tty = ttyslot();
     if (tty > 0 && (fd = open(UTMP_FILE, O_WRONLY, 0)) >= 0) {
        (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
        (void)write(fd, (char *)ent, sizeof(struct utmp));
@@ -139,6 +140,11 @@ void update_utmp(ent, username, line, host)
 void update_wtmp(ent)
     struct utmp *ent;
 {
+#ifndef HAVE_SETUTENT
+    struct utmp ut;
+    struct stat statb;
+    int fd;
+#endif /* !HAVE_SETUTENT */
 #ifdef HAVE_SETUTXENT
     struct utmpx utx;