From owner-svn-src-head@freebsd.org Tue Mar 12 05:43:40 2019 Return-Path: Delivered-To: svn-src-head@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 EEB0A1545743 for ; Tue, 12 Mar 2019 05:43:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF827598C for ; Tue, 12 Mar 2019 05:43:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x741.google.com with SMTP id u22so721677qkj.11 for ; Mon, 11 Mar 2019 22:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DGfOffF212KPOctWRXDIkPY+0USgUZ+gJjnm4Q+ZxBE=; b=0pbPYmwH7GruIqkiHhLi5pzqgQOT6pTQByBKNLvk/1iNfxUY0JX0X6K01fEHhrkIOD avYzljz5v4WZKceghjV1Ste8VCWEnjGHrUVu/x9Xz/t0UNf1f3STb2fIIjgAsT32ne8K lg4agYlDdH7xXSL9QRr5+GrBQLAHvQDJnb9GW1H6bVmS+/+eTXG2i3oW+JKuJrDjSN4a 09YmbwhSoW1t5yUApZv9Nljq71E6H97vxvKDJ+6ottVcdjJxnE4SRF68FokcksYPYGvI QjOoJ5AjMeX3fsSHthSdLKuE+GfP9n7QdpFRd3Xba8tAQIPveLvMpxEeQ4qZ/Ob382fF 0RWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DGfOffF212KPOctWRXDIkPY+0USgUZ+gJjnm4Q+ZxBE=; b=n5NtOFNNxNBRuYfqH4pMEUIw/SUnxIhDYD9cqbZPRTwFvDQWNKHrkwGgrDMfbDdAus eMGtHxF2fPKXbbqenuh6ur3Q/QJY7/wGYPs1oEpGHTzOQ8bszZ0tZR/5+aimW6l5APCB qWT1Ajjmk8XR9GLUjOw1M5uBQeb/7sMPS27T83rst8OCqGUght4nm/UvwyAcrYMaQXFS dUKMSBN3zXUm/cDeVKkj9pWzdTrD9LzX8gzrShP3OJu7nj4uZUFF6aWPdwsCCL+wDl9T 6RTHcSdXaVrQ9gYo5bbohPYPcSi1CKq4EvLaZDaiJFC8iL0SqiTqHshQiG88t1l4MGuq PClw== X-Gm-Message-State: APjAAAXk2hSu6uEtwU+TDGkPy2tmd2KY8XV+hX7C5TlYyb34Qnpgg3ZF fcNjy/bgps2WA09Q1shFrH3MrQwuIOpV1FJRZnWYNg== X-Google-Smtp-Source: APXvYqznmxwtbsxsuqpSqO/sW+GBI9LjEKXnmqECYB+b6kWB7IxiY7rvAS9XHSPOD0b6hIGpTDiISqCktwIK5AnvxI0= X-Received: by 2002:a37:6fc2:: with SMTP id k185mr23658693qkc.175.1552369418682; Mon, 11 Mar 2019 22:43:38 -0700 (PDT) MIME-Version: 1.0 References: <201903120515.x2C5Fbtw013485@gndrsh.dnsmgr.net> <201903120525.x2C5PH7X013552@gndrsh.dnsmgr.net> In-Reply-To: <201903120525.x2C5PH7X013552@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 11 Mar 2019 23:43:27 -0600 Message-ID: Subject: Re: svn commit: r345050 - head/bin/date To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 6CF827598C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 05:43:40 -0000 On Mon, Mar 11, 2019 at 11:25 PM Rodney W. Grimes wrote: > > > 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@ > Nits: jhb@ and I see he did comment in the review, but he did not > accept it as a reviewew at the top. > This is why I think just the reference to the differential revision is perfectly fine. Why duplicate data? Others complained I hadn't included it. He commented, we discussed it on irc (though most of it was about how to use arc better), etc. I thought it warranted it. So please don't nitpick. This level is really annoying and frustrating. Does this really help us produce a better product? > > Differential Revision: https://reviews.freebsd.org/D19550 > > > > Can we get a commit to stable/12 that puts out a warning if > > anyone uses -d or -t to the date command please? > I don't think it's worth it for a feature that's been obsolete for 20 years, but if someone else wants to do so, I'll not object. And I just noticed you did not fix the man page for this. > Ah, yes. I'll fix that. Warner > > > 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]]", > > > " " > > > > > > > > > > -- > > Rod Grimes > rgrimes@freebsd.org > > > > > > -- > Rod Grimes > rgrimes@freebsd.org >