aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/touch
Commit message (Collapse)AuthorAgeFilesLines
* touch.1: Update to conform to POSIX 2004Conrad Meyer2018-06-011-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <vsahu AT isilon.com> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=334501
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-272-65/+45
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge from headSimon J. Gerraty2013-09-051-21/+23
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync from headSimon J. Gerraty2012-11-042-5/+95
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | touch(1): Xref utimensat(2) instead of utimes(2).Jilles Tjoelker2015-03-081-2/+2
| | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=279795
* | | | touch: Fix some subtle bugs related to NULL times fallback:Jilles Tjoelker2015-02-151-28/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not subvert vfs.timestamp_precision by reading the time and passing that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times pointer is no longer used. * Do not ignore -a/-m if the user has write access but does not own the file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to a NULL times pointer (which would set both timestamps) if that fails. Reviewed by: bde Notes: svn path=/head/; revision=278817
* | | | cp,mv,touch: Set timestamps with nanosecond precision.Jilles Tjoelker2015-01-241-41/+38
| |_|/ |/| | | | | | | | | | | | | | | | | This uses utimensat(). Notes: svn path=/head/; revision=277645
* | | Constify where appropriate.Eitan Adler2013-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by: emaste Approved by: cperciva (mentor) MFC After: 3 days Notes: svn path=/head/; revision=249806
* | | Cleanups to touch.cEitan Adler2013-04-231-20/+22
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | - use const where appropriate - use static where appropriate - use explicit checks checks for error conditions Reviewed by: sbruno Approved by: cperciva (mentor) Obtained by: DragonFlyBSD Notes: svn path=/head/; revision=249805
* | touch: Add the -d option from POSIX.1-2008.Jilles Tjoelker2012-06-102-5/+95
|/ | | | | | | | | | | | | This is much like -t but with a different format which is ISO8601-like and allows fractions of a second. The precision is limited to microseconds because of utimes() and friends, even though stat() returns nanoseconds. MFC after: 10 days Notes: svn path=/head/; revision=236852
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-6/+6
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Remove useless and potentially dangerous rw() function which tries toJaakko Heinonen2012-02-042-67/+8
| | | | | | | | | | | | | update access and modification times by reading and writing the file. chmod(2) in rw() doesn't help because utimes(2) allow owner and the super-user to change times. Using just utimes(2) should be sufficient. The -f option becomes no-op. Reviewed by: jilles Notes: svn path=/head/; revision=230979
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Change all our own code to use st_*tim instead of st_*timespec.Ed Schouten2010-03-281-6/+6
| | | | | | | Also remove some local patches to diff(1) which are now unneeded. Notes: svn path=/head/; revision=205793
* - If lstat()/stat() fails with an error other than ENOENT, don't ignoreJaakko Heinonen2009-10-161-4/+11
| | | | | | | | | | | | | | | | | | the error and assume that the file doesn't exist. Touch could return success with -c option even if the file existed and time was not set. - If the first utimes_f() call fails with -A option, give up and don't continue trying to set times to current time. [1] - Set exit status to 1 when setting of timestamps fails for a directory or symbolic link even though lstat()/stat() would succeed. - Don't print bogus error message when rw() succeeds. PR: bin/112213 Submitted by: jilles [1] Reviewed by: jilles Approved by: trasz (mentor) Notes: svn path=/head/; revision=198175
* Update to match revision 1.23 of touch.c.Greg Lehey2007-04-101-36/+18
| | | | | | | Clarify some details. Notes: svn path=/head/; revision=168572
* Usage: print base name of program.Greg Lehey2007-04-101-20/+47
| | | | | | | | | | -A flag: respect the -a and -m flags. imply the -c flag. Requested in principle by: brian Notes: svn path=/head/; revision=168571
* Add -A flag to adjust existing time stamps.Greg Lehey2007-04-092-23/+130
| | | | | | | | | Print name by which program was started in usage() message. MFC after: 2 weeks Notes: svn path=/head/; revision=168525
* Don't set time to current, if set to specific time failsAndrey A. Chernov2006-01-311-0/+1
| | | | | | | PR: 92577 Notes: svn path=/head/; revision=155082
* Expand *n't contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141846
* Sort sections.Ruslan Ermilov2005-01-181-7/+7
| | | | Notes: svn path=/head/; revision=140420
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* ANSIify function definitions.David Malone2002-09-041-18/+6
| | | | | | | | | | | | Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5 Notes: svn path=/head/; revision=102944
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-251-1/+1
| | | | Notes: svn path=/head/; revision=102412
* Remove local prototypes for main().Juli Mallett2002-08-191-1/+0
| | | | Notes: svn path=/head/; revision=102084
* Handle directories correctly.Eric Melville2002-07-231-3/+6
| | | | | | | | PR: 40801 MFC after: 5 days Notes: svn path=/head/; revision=100546
* remove __PWarner Losh2002-03-221-6/+6
| | | | Notes: svn path=/head/; revision=92922
* WARNS=2 is going to be the default, so don't specify it. Use __FBSDID().Mark Murray2001-12-112-6/+5
| | | | Notes: svn path=/head/; revision=87706
* Clarify that -h implies -c.David E. O'Brien2001-09-241-0/+5
| | | | Notes: svn path=/head/; revision=83896
* blah, remove debugging code that crept in with last commit.David E. O'Brien2001-09-231-1/+0
| | | | Notes: svn path=/head/; revision=83846
* Add the 'h' flag to operate on symlinks rather than what they point to.David E. O'Brien2001-09-222-6/+19
| | | | Notes: svn path=/head/; revision=83826
* mdoc(7) police: utilize the new .Ex macro.Ruslan Ermilov2001-08-151-3/+1
| | | | Notes: svn path=/head/; revision=81687
* Fix some trivial warnings and clamp down with WARNS=2Kris Kennaway2001-05-262-2/+9
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=77247
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-1/+1
| | | | Notes: svn path=/head/; revision=68963
* Add DIAGNOSTICS section namePhilippe Charnier2000-03-261-1/+1
| | | | Notes: svn path=/head/; revision=58628
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde Notes: svn path=/head/; revision=48792
* Clean up some ambiguous nested if/elses.Bill Fumerola1999-07-041-1/+2
| | | | Notes: svn path=/head/; revision=48566
* Brucify.Dag-Erling Smørgrav1999-05-121-2/+1
| | | | Notes: svn path=/head/; revision=47042
* Sync usage() with man page.Dag-Erling Smørgrav1999-05-111-2/+2
| | | | | | | | PR: 11539 Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua> Notes: svn path=/head/; revision=47016