BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.bin / last / last.c
index 63f27b2..99a4652 100644 (file)
@@ -2,19 +2,33 @@
  * Copyright (c) 1987 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1987 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement:  ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
@@ -24,7 +38,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)last.c     5.17 (Berkeley) 6/1/90";
+static char sccsid[] = "@(#)last.c     5.18 (Berkeley) 3/1/91";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -130,7 +144,6 @@ main(argc, argv)
  * wtmp --
  *     read through the wtmp file
  */
  * wtmp --
  *     read through the wtmp file
  */
-static
 wtmp()
 {
        register struct utmp    *bp;            /* current structure */
 wtmp()
 {
        register struct utmp    *bp;            /* current structure */
@@ -138,11 +151,11 @@ wtmp()
        struct stat     stb;                    /* stat of file for size */
        long    bl, delta,                      /* time difference */
                lseek(), time();
        struct stat     stb;                    /* stat of file for size */
        long    bl, delta,                      /* time difference */
                lseek(), time();
-       int     bytes, wfd,
-               onintr();
+       int     bytes, wfd;
        char    *ct, *crmsg,
                *asctime(), *ctime(), *strcpy();
        TTY     *addtty();
        char    *ct, *crmsg,
                *asctime(), *ctime(), *strcpy();
        TTY     *addtty();
+       void    onintr();
 
        if ((wfd = open(file, O_RDONLY, 0)) < 0 || fstat(wfd, &stb) == -1) {
                perror(file);
 
        if ((wfd = open(file, O_RDONLY, 0)) < 0 || fstat(wfd, &stb) == -1) {
                perror(file);
@@ -237,7 +250,6 @@ wtmp()
  * want --
  *     see if want this entry
  */
  * want --
  *     see if want this entry
  */
-static
 want(bp, check)
        register struct utmp *bp;
        int check;
 want(bp, check)
        register struct utmp *bp;
        int check;
@@ -279,7 +291,6 @@ want(bp, check)
  * addarg --
  *     add an entry to a linked list of arguments
  */
  * addarg --
  *     add an entry to a linked list of arguments
  */
-static
 addarg(type, arg)
        int type;
        char *arg;
 addarg(type, arg)
        int type;
        char *arg;
@@ -301,7 +312,7 @@ addarg(type, arg)
  * addtty --
  *     add an entry to a linked list of ttys
  */
  * addtty --
  *     add an entry to a linked list of ttys
  */
-static TTY *
+TTY *
 addtty(ttyname)
        char *ttyname;
 {
 addtty(ttyname)
        char *ttyname;
 {
@@ -324,7 +335,6 @@ addtty(ttyname)
  *     has a domain attached that is the same as the current domain, rip
  *     off the domain suffix since that's what login(1) does.
  */
  *     has a domain attached that is the same as the current domain, rip
  *     off the domain suffix since that's what login(1) does.
  */
-static
 hostconv(arg)
        char *arg;
 {
 hostconv(arg)
        char *arg;
 {
@@ -350,7 +360,7 @@ hostconv(arg)
  * ttyconv --
  *     convert tty to correct name.
  */
  * ttyconv --
  *     convert tty to correct name.
  */
-static char *
+char *
 ttyconv(arg)
        char *arg;
 {
 ttyconv(arg)
        char *arg;
 {
@@ -383,7 +393,7 @@ ttyconv(arg)
  * onintr --
  *     on interrupt, we inform the user how far we've gotten
  */
  * onintr --
  *     on interrupt, we inform the user how far we've gotten
  */
-static
+void
 onintr(signo)
        int signo;
 {
 onintr(signo)
        int signo;
 {