delete get_date, just use strftime
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 22 Jan 1991 01:44:43 +0000 (17:44 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 22 Jan 1991 01:44:43 +0000 (17:44 -0800)
SCCS-vsn: libexec/getty/Makefile 5.12
SCCS-vsn: libexec/telnetd/Makefile 5.12
SCCS-vsn: libexec/telnetd/utility.c 5.5

usr/src/libexec/getty/Makefile
usr/src/libexec/telnetd/Makefile
usr/src/libexec/telnetd/utility.c

index f44103f..8f64a00 100644 (file)
@@ -1,7 +1,7 @@
-#      @(#)Makefile    5.11 (Berkeley) %G%
+#      @(#)Makefile    5.12 (Berkeley) %G%
 
 PROG=  getty
 
 PROG=  getty
-SRCS=  main.c init.c subr.c gettytab.c get_date.c ttydefaults.c
+SRCS=  main.c init.c subr.c gettytab.c ttydefaults.c
 DPADD= ${LIBUTIL}
 LDADD= -lutil
 MAN5=  gettytab.0 ttys.0
 DPADD= ${LIBUTIL}
 LDADD= -lutil
 MAN5=  gettytab.0 ttys.0
index 8670b76..f401f56 100644 (file)
@@ -1,8 +1,8 @@
-#      @(#)Makefile    5.11 (Berkeley) %G%
+#      @(#)Makefile    5.12 (Berkeley) %G%
 
 PROG=  telnetd
 CFLAGS+=-DNEED_GETTOS -DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO -DDIAGNOSTICS
 
 PROG=  telnetd
 CFLAGS+=-DNEED_GETTOS -DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO -DDIAGNOSTICS
-SRCS=  get_date.c gettytab.c global.c slc.c state.c sys_term.c telnetd.c \
+SRCS=  gettytab.c global.c slc.c state.c sys_term.c telnetd.c \
        termstat.c utility.c
 DPADD= ${LIBUTIL} ${LIBTERM}
 LDADD= -lutil -ltermcap
        termstat.c utility.c
 DPADD= ${LIBUTIL} ${LIBTERM}
 LDADD= -lutil -ltermcap
index 516043d..62eda9b 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)utility.c  5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)utility.c  5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #define PRINTOPTIONS
 #endif /* not lint */
 
 #define PRINTOPTIONS
@@ -379,10 +379,8 @@ putf(cp, where)
 register char *cp;
 char *where;
 {
 register char *cp;
 char *where;
 {
-       char *slash;
-#ifndef        NO_GETTYTAB
-       char datebuffer[60];
-#endif /* NO_GETTYTAB */
+       time_t t;
+       char *fmt, *slash, db[100];
        extern char *rindex();
 
        putlocation = where;
        extern char *rindex();
 
        putlocation = where;
@@ -406,12 +404,14 @@ char *where;
                        putstr(editedhost);
                        break;
 
                        putstr(editedhost);
                        break;
 
-#ifndef        NO_GETTYTAB
                case 'd':
                case 'd':
-                       get_date(datebuffer);
-                       putstr(datebuffer);
+                       (void)time(&t);
+                                               /* SCCS *likes* utility.c... */
+                       fmt = "%l:% %P on %A, %d %B %Y";
+                       fmt[4] = 'M';
+                       (void)strftime(db, sizeof(db), fmt, &t);
+                       putstr(db);
                        break;
                        break;
-#endif /* NO_GETTYTAB */
 
                case '%':
                        putchr('%');
 
                case '%':
                        putchr('%');