From owner-svn-src-all@freebsd.org Tue Mar 12 04:50:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 709AA15440D5; Tue, 12 Mar 2019 04:50:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0358B72DFF; Tue, 12 Mar 2019 04:50:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 739AD1DA9A; Tue, 12 Mar 2019 04:49:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2C4nxvp069720; Tue, 12 Mar 2019 04:49:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2C4nxKQ069719; Tue, 12 Mar 2019 04:49:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201903120449.x2C4nxKQ069719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 Mar 2019 04:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345050 - head/bin/date X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/bin/date X-SVN-Commit-Revision: 345050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0358B72DFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 04:50:00 -0000 Author: imp Date: Tue Mar 12 04:49:59 2019 New Revision: 345050 URL: https://svnweb.freebsd.org/changeset/base/345050 Log: Remove now useless -d and -t flags. These were used to set dst flag and minutes west of UTC respectively. These are obsolete and have been removed form the kernel. These existed primarily to faithfully emulate early Unix ABIs that have been removed from FreeBSD. Reviewed by: jbh@, brooks@ Differential Revision: https://reviews.freebsd.org/D19550 Modified: head/bin/date/date.c Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Tue Mar 12 04:49:47 2019 (r345049) +++ head/bin/date/date.c Tue Mar 12 04:49:59 2019 (r345050) @@ -91,14 +91,12 @@ static const char *rfc2822_format = "%a, %d %b %Y %T % int main(int argc, char *argv[]) { - struct timezone tz; int ch, rflag; bool Iflag, jflag, nflag, Rflag; const char *format; char buf[1024]; - char *endptr, *fmt; + char *fmt; char *tmp; - int set_timezone; struct vary *v; const struct vary *badv; struct tm *lt; @@ -108,18 +106,10 @@ main(int argc, char *argv[]) v = NULL; fmt = NULL; (void) setlocale(LC_TIME, ""); - tz.tz_dsttime = tz.tz_minuteswest = 0; rflag = 0; Iflag = jflag = nflag = Rflag = 0; - set_timezone = 0; - while ((ch = getopt(argc, argv, "d:f:I::jnRr:t:uv:")) != -1) + while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1) switch((char)ch) { - case 'd': /* daylight savings time */ - tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0; - if (endptr == optarg || *endptr != '\0') - usage(); - set_timezone = 1; - break; case 'f': fmt = optarg; break; @@ -160,13 +150,6 @@ main(int argc, char *argv[]) usage(); } break; - case 't': /* minutes west of UTC */ - /* error check; don't allow "PST" */ - tz.tz_minuteswest = strtol(optarg, &endptr, 10); - if (endptr == optarg || *endptr != '\0') - usage(); - set_timezone = 1; - break; case 'u': /* do everything in UTC */ (void)setenv("TZ", "UTC0", 1); break; @@ -179,13 +162,6 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - /* - * If -d or -t, set the timezone or daylight savings time; this - * doesn't belong here; the kernel should not know about either. - */ - if (set_timezone && settimeofday(NULL, &tz) != 0) - err(1, "settimeofday (timezone)"); - if (!rflag && time(&tval) == -1) err(1, "time"); @@ -411,8 +387,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] " - "[-v[+|-]val[ymwdHMS]]", + "usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]]", " " "[-I[date | hours | minutes | seconds]]", " "