more ANSI fixes
[unix-history] / usr / src / libexec / getty / main.c
index 4662ab6..09ba98f 100644 (file)
@@ -12,20 +12,23 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.14 (Berkeley) %G%";
 #endif /* not lint */
 
 #define USE_OLD_TTY
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #define USE_OLD_TTY
 
 #include <sys/param.h>
-#include <sys/signal.h>
-#include <sys/file.h>
+#include <sys/stat.h>
+#include <signal.h>
+#include <fcntl.h>
 #include <sgtty.h>
 #include <sgtty.h>
+#include <time.h>
 #include <ctype.h>
 #include <setjmp.h>
 #include <syslog.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <ctype.h>
 #include <setjmp.h>
 #include <syslog.h>
 #include <unistd.h>
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 #include "gettytab.h"
 #include "pathnames.h"
 #include <string.h>
 #include "gettytab.h"
 #include "pathnames.h"
@@ -86,6 +89,7 @@ char partab[] = {
 
 jmp_buf timeout;
 
 
 jmp_buf timeout;
 
+static void
 dingdong()
 {
 
 dingdong()
 {
 
@@ -96,6 +100,7 @@ dingdong()
 
 jmp_buf        intrupt;
 
 
 jmp_buf        intrupt;
 
+static void
 interrupt()
 {
 
 interrupt()
 {
 
@@ -447,12 +452,15 @@ putf(cp)
                        puts(editedhost);
                        break;
 
                        puts(editedhost);
                        break;
 
-               case 'd':
+               case 'd': {
+                       char fmt[] = "%l:% %P on %A, %d %B %Y";
+
+                       fmt[4] = 'M';           /* I *hate* SCCS... */
                        (void)time(&t);
                        (void)time(&t);
-                       (void)strftime(db,
-                           sizeof(db), "%l:main.cP on %A, %d %B %Y", &t);
+                       (void)strftime(db, sizeof(db), fmt, localtime(&t));
                        puts(db);
                        break;
                        puts(db);
                        break;
+               }
 
                case '%':
                        putchr('%');
 
                case '%':
                        putchr('%');