Index: bin/date/date.1 =================================================================== --- bin/date/date.1 +++ bin/date/date.1 @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd March 12, 2019 +.Dd March 20, 2019 .Dt DATE 1 .Os .Sh NAME @@ -52,13 +52,13 @@ .Ar ... .Op Cm + Ns Ar output_fmt .Nm -.Op Fl jnu +.Op Fl ju .Sm off .Op Oo Oo Oo Oo Ar cc Oc Ar yy Oc Ar mm Oc Ar dd Oc Ar HH .Ar MM Op Ar .ss .Sm on .Nm -.Op Fl jnRu +.Op Fl jRu .Fl f Ar input_fmt new_date .Op Cm + Ns Ar output_fmt .Nm @@ -142,16 +142,6 @@ flag in addition to the .Cm + option to convert one date format to another. -.It Fl n -By default, if the -.Xr timed 8 -daemon is running, -.Nm -sets the time on all of the machines in the local group. -The -.Fl n -option suppresses this behavior and causes the time to be set only on the -current machine. .It Fl R Use RFC 2822 date and time output format. This is equivalent to using @@ -431,23 +421,6 @@ .Nm and express it in Epoch time. .Sh DIAGNOSTICS -Occasionally, when -.Xr timed 8 -synchronizes the time on many hosts, the setting of a new time value may -require more than a few seconds. -On these occasions, -.Nm -prints: -.Ql Network time being set . -The message -.Ql Communication error with timed -occurs when the communication -between -.Nm -and -.Xr timed 8 -fails. -.Pp It is invalid to combine the .Fl I flag with either Index: bin/date/date.c =================================================================== --- bin/date/date.c +++ bin/date/date.c @@ -72,7 +72,7 @@ static void multipleformats(void); static void printdate(const char *); static void printisodate(struct tm *); -static void setthetime(const char *, const char *, int, int); +static void setthetime(const char *, const char *, int); static void usage(void); static const struct iso8601_fmt { @@ -92,7 +92,7 @@ main(int argc, char *argv[]) { int ch, rflag; - bool Iflag, jflag, nflag, Rflag; + bool Iflag, jflag, Rflag; const char *format; char buf[1024]; char *fmt; @@ -107,8 +107,8 @@ fmt = NULL; (void) setlocale(LC_TIME, ""); rflag = 0; - Iflag = jflag = nflag = Rflag = 0; - while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1) + Iflag = jflag = Rflag = 0; + while ((ch = getopt(argc, argv, "f:I::jRr:uv:")) != -1) switch((char)ch) { case 'f': fmt = optarg; @@ -132,9 +132,6 @@ case 'j': jflag = 1; /* don't set time */ break; - case 'n': /* don't set network */ - nflag = 1; - break; case 'R': /* RFC 2822 datetime format */ if (Iflag) multipleformats(); @@ -179,7 +176,7 @@ } if (*argv) { - setthetime(fmt, *argv, jflag, nflag); + setthetime(fmt, *argv, jflag); ++argv; } else if (fmt != NULL) usage(); @@ -250,7 +247,7 @@ #define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0')) static void -setthetime(const char *fmt, const char *p, int jflag, int nflag) +setthetime(const char *fmt, const char *p, int jflag) { struct utmpx utx; struct tm *lt; @@ -343,20 +340,17 @@ errx(1, "nonexistent time"); if (!jflag) { - /* set the time */ - if (nflag) { - utx.ut_type = OLD_TIME; - memset(utx.ut_id, 0, sizeof(utx.ut_id)); - (void)gettimeofday(&utx.ut_tv, NULL); - pututxline(&utx); - tv.tv_sec = tval; - tv.tv_usec = 0; - if (settimeofday(&tv, NULL) != 0) - err(1, "settimeofday (timeval)"); - utx.ut_type = NEW_TIME; - (void)gettimeofday(&utx.ut_tv, NULL); - pututxline(&utx); - } + utx.ut_type = OLD_TIME; + memset(utx.ut_id, 0, sizeof(utx.ut_id)); + (void)gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); + tv.tv_sec = tval; + tv.tv_usec = 0; + if (settimeofday(&tv, NULL) != 0) + err(1, "settimeofday (timeval)"); + utx.ut_type = NEW_TIME; + (void)gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); if ((p = getlogin()) == NULL) p = "???";