From owner-svn-src-head@freebsd.org Fri Jun 1 22:35:00 2018 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 6D7A8FDB6A1; Fri, 1 Jun 2018 22:35:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA8C7812C; Fri, 1 Jun 2018 22:35:00 +0000 (UTC) (envelope-from cem@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 F233A2EEB9; Fri, 1 Jun 2018 22:34:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w51MYxRf097185; Fri, 1 Jun 2018 22:34:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w51MYxCF097184; Fri, 1 Jun 2018 22:34:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806012234.w51MYxCF097184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Jun 2018 22:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334501 - head/usr.bin/touch X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/touch X-SVN-Commit-Revision: 334501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Fri, 01 Jun 2018 22:35:00 -0000 Author: cem Date: Fri Jun 1 22:34:59 2018 New Revision: 334501 URL: https://svnweb.freebsd.org/changeset/base/334501 Log: touch.1: Update to conform to POSIX 2004 POSIX borrowed the "double leap second" bug from C89. Double leap seconds can never happen. This mistake was present in at least POSIX 1997 and fixed by POSIX 2004. I can't find a copy of 2001 online to determine if the bug was present in that revision. While here, remove duplicate language between -d and -t. A few other minor enhancements and an igor (lint) bugfix. Further reading: 2018 POSIX (documents -d): http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html 2004 POSIX (documents SS from 0-60): http://pubs.opengroup.org/onlinepubs/009695399/utilities/touch.html 1997 POSIX/SUSv2 (historical interest, 0-61): http://pubs.opengroup.org/onlinepubs/007908799/xcu/touch.html More on this subject (start at "Unix system time and the POSIX standard") https://www.ucolick.org/~sla/leapsecs/onlinebib.html And: https://marc.info/?l=openbsd-tech&m=92682843416159&w=2 Reported by: Vishal Sahu Sponsored by: Dell EMC Isilon Modified: head/usr.bin/touch/touch.1 Modified: head/usr.bin/touch/touch.1 ============================================================================== --- head/usr.bin/touch/touch.1 Fri Jun 1 22:09:27 2018 (r334500) +++ head/usr.bin/touch/touch.1 Fri Jun 1 22:34:59 2018 (r334501) @@ -31,7 +31,7 @@ .\" @(#)touch.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd March 8, 2015 +.Dd June 1, 2018 .Dt TOUCH 1 .Os .Sh NAME @@ -53,7 +53,8 @@ If any file does not exist, it is created with default .Pp By default, .Nm -changes both modification and access times. The +changes both modification and access times. +The .Fl a and .Fl m @@ -113,39 +114,36 @@ The utility does not treat this as an error. No error messages are displayed and the exit value is not affected. .It Fl d -Change the access and modification times to the specified time instead +Change the access and modification times to the specified date time instead of the current time of day. The argument is of the form .Dq YYYY-MM-DDThh:mm:SS[.frac][tz] where the letters represent the following: .Bl -tag -width Ds -compact -offset indent .It Ar YYYY -The year. -.It Ar MM -The month of the year, from 01 to 12. -.It Ar DD -The day of the month, from 01 to 31. +At least four decimal digits representing the year. +.It Ar MM , Ar DD , Ar hh , Ar mm , Ar SS +As with +.Fl t +time. .It Ar T The letter .Li T -or a space. -.It Ar hh -The hour of the day, from 00 to 23. -.It Ar mm -The minute of the hour, from 00 to 59. -.It Ar SS -The second of the minute, from 00 to 61. +or a space is the time designator. .It Ar .frac -An optional fraction, -consisting of a period or a comma followed by one or more digits. -The number of significant digits depends on the kernel configuration and -the filesystem, and may be zero. +An optional fraction, consisting of a period or a comma followed by one or +more digits. +The number of significant digits depends on the kernel configuration and the +filesystem, and may be zero. .It Ar tz An optional letter .Li Z indicating the time is in .Tn UTC . Otherwise, the time is assumed to be in local time. +Local time is affected by the value of the +.Ev TZ +environment variable. .El .It Fl h If the file is a symbolic link, change the times of the link @@ -196,7 +194,7 @@ The hour of the day, from 00 to 23. .It Ar mm The minute of the hour, from 00 to 59. .It Ar SS -The second of the minute, from 00 to 61. +The second of the minute, from 00 to 60. .El .Pp If the