tool changes
This commit is contained in:
parent
f5c6b13fa0
commit
634a80273e
|
@ -1,10 +1,15 @@
|
|||
# $NetBSD: Makefile,v 1.15 2011/08/14 10:53:16 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.16 2021/05/26 20:19:51 christos Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
PROG= date
|
||||
SRCS= date.c netdate.c
|
||||
SRCS= date.c
|
||||
.if !defined(HOSTPROG)
|
||||
SRCS+= netdate.c
|
||||
DPADD+= ${LIBUTIL}
|
||||
LDADD+= -lutil
|
||||
.endif
|
||||
CPPFLAGS+=-I${.CURDIR}
|
||||
|
||||
COPTS.date.c = -Wno-format-nonliteral
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: date.c,v 1.61 2014/09/01 21:42:21 dholland Exp $ */
|
||||
/* $NetBSD: date.c,v 1.62 2021/05/26 20:19:51 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, 1987, 1988, 1993
|
||||
|
@ -29,6 +29,10 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__COPYRIGHT(
|
||||
|
@ -40,7 +44,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: date.c,v 1.61 2014/09/01 21:42:21 dholland Exp $");
|
||||
__RCSID("$NetBSD: date.c,v 1.62 2021/05/26 20:19:51 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -90,6 +94,7 @@ main(int argc, char *argv[])
|
|||
nflag = 1;
|
||||
break;
|
||||
case 'd':
|
||||
#ifndef HAVE_NBTOOL_CONFIG_H
|
||||
rflag = 1;
|
||||
tval = parsedate(optarg, NULL, NULL);
|
||||
if (tval == -1) {
|
||||
|
@ -97,6 +102,10 @@ main(int argc, char *argv[])
|
|||
"%s: Unrecognized date format", optarg);
|
||||
}
|
||||
break;
|
||||
#else
|
||||
errx(EXIT_FAILURE,
|
||||
"-d not supported in the tool version");
|
||||
#endif
|
||||
case 'j': /* don't set time */
|
||||
jflag = 1;
|
||||
break;
|
||||
|
@ -330,6 +339,7 @@ setthetime(const char *p)
|
|||
}
|
||||
|
||||
/* set the time */
|
||||
#ifndef HAVE_NBTOOL_CONFIG_H
|
||||
if (nflag || netsettime(new_time)) {
|
||||
logwtmp("|", "date", "");
|
||||
if (aflag) {
|
||||
|
@ -346,6 +356,9 @@ setthetime(const char *p)
|
|||
}
|
||||
logwtmp("{", "date", "");
|
||||
}
|
||||
#else
|
||||
errx(EXIT_FAILURE, "Can't set the time in the tools version");
|
||||
#endif
|
||||
|
||||
if ((p = getlogin()) == NULL)
|
||||
p = "???";
|
||||
|
|
Loading…
Reference in New Issue