use logwtmp()
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 21 Sep 1988 04:44:29 +0000 (20:44 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 21 Sep 1988 04:44:29 +0000 (20:44 -0800)
SCCS-vsn: sbin/reboot/reboot.c 5.5

usr/src/sbin/reboot/reboot.c

index 2d9831f..6d03a95 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)reboot.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)reboot.c   5.5 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -96,7 +96,7 @@ main(argc, argv)
        }
 
        if (!qflag && (howto & RB_NOSYNC) == 0) {
        }
 
        if (!qflag && (howto & RB_NOSYNC) == 0) {
-               markdown();
+               logwtmp("~", "shutdown", "");
                sync();
                setalarm(5);
                pause();
                sync();
                setalarm(5);
                pause();
@@ -117,22 +117,3 @@ setalarm(n)
        signal(SIGALRM, dingdong);
        alarm(n);
 }
        signal(SIGALRM, dingdong);
        alarm(n);
 }
-
-#include <utmp.h>
-#define SCPYN(a, b)    strncpy(a, b, sizeof(a))
-char   wtmpf[] = "/usr/adm/wtmp";
-struct utmp wtmp;
-
-markdown()
-{
-       register f = open(wtmpf, 1);
-       if (f >= 0) {
-               lseek(f, 0L, 2);
-               SCPYN(wtmp.ut_line, "~");
-               SCPYN(wtmp.ut_name, "shutdown");
-               SCPYN(wtmp.ut_host, "");
-               time(&wtmp.ut_time);
-               write(f, (char *)&wtmp, sizeof(wtmp));
-               close(f);
-       }
-}