summaryrefslogtreecommitdiffstats
path: root/bin/date
Commit message (Collapse)AuthorAgeFilesLines
* MFC r282608:delphij2015-05-212-4/+13
| | | | | | | | date(1): Make -r behave like GNU's version when the option can not be interpreted as a number, which checks the file's modification time and use that as the date/time value. This improves compatibility with GNU coreutils's version of date(1).
* MFC r269903:ngie2014-08-293-92/+93
| | | | | | | | | | Port date/bin/tests to ATF Phabric: D545 Approved by: jmmv (mentor) Submitted by: keramida (earlier version) Sponsored by: Google, Inc Sponsored by: EMC / Isilon Storage Division
* date(1): Add "-R" flag to use RFC 2822 date and time output format [MFC]dumbbell2014-05-032-7/+33
| | | | | | | | | As stated in the man page, this is equivalent to use "%a, %d %b %Y %T %z" as the output format while LC_TIME is set to the "C" locale. This is compatible with date(1) from the GNU core utilities. This is an MFC of r264968 and r264970.
* MFC refactoring of the *.test.mk files.jmmv2014-04-141-1/+1
| | | | | | | | | - r263161 Make bsd.test.mk the only public mk fragment for the building of tests. - r263172 Move FreeBSD Test Suite-specific code to a suite.test.mk file. - r263204 Add some documentation for bsd.test.mk. - r263217 Document support for TAP-compliant Perl test programs. This is "make tinderbox" clean.
* Sync sh(1) in stable/10 to head.jmmv2014-03-093-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a MFC of all the commits listed below. My original goal of this change was to only merge the move of the tests from tools/regression/bin/ into the new layout (which include tests for sh(1) and other tools as well). However, doing so is tricky due to the ongoing work in sh(1) and, especially, the many changes to its tests since stable/10 was first branched. Merging everything is the simplest way to achieve this goal and, as a bonus point, we get various fixes and miscellaneous improvements into the branch. Per jilles' suggestion, I'm avoiding the merge of a couple of changes (r256850 and r257506) that required depending kernel changes. I'm also avoiding very recent changes that have not had a long enough time to be validated in current. This is "make tinderbox" clean. r256735 sh: Remove one syscall when waiting for a foreground job. r257399 sh: Allow trapping SIGINT/SIGQUIT after ignore because of '&'. r257504 sh: Reorder union node to reduce its size on 64-bit platforms. r257920 sh: Add a test case for would-be assignments that are not due to quoting. r257929 sh: Properly quote alias output from command -v. r258489 sh: Add tests for the </dev/null implicit in a background command. r258533 sh: Add more tests for the </dev/null implicit in a background command. r258535 sh: Make <&0 disable the </dev/null implicit in a background command. r258776 sh: Prefer memcpy() to strcpy() in most cases. Remove the scopy macro. r259047 sh: Split set -x output into a separate function. r259210 Migrate tools/regression/bin/ tests to the new layout. r259844 sh: Remove an unused variable. r259846 sh: Initialize OPTIND=1 even if it came from the environment. r259874 sh: Simplify code related to PPID variable. r259946 sh: Don't check input for non-whitespace if history is disabled. r260246 sh(1): Discourage use of -e. r260506 Run the sh(1) and test(1) tests as unprivileged. r260586 Mark the bin/pax tests as requiring perl. r260634 Use TAP_TESTS_PERL to register the legacy_test in bin/pax. r260635 Replace hand-crafted Kyuafiles with automatic generation. r260654 sh: Remove SIGWINCH handler and just check for resize before every read. r261121 sh: Add test for nested alias. r261125 sh: Solve the alias recursion problem in a less hackish way. r261141 sh: Do not depend on parse/execute split in new alias test. r261160 sh: Add tests for alias names after another alias. r261192 sh: Allow aliases to force alias substitution on the following word. r262533 sh: Make expari() static. r262565 sh: Do not corrupt internal representation if LINENO inner expansion fails. r262697 sh: Simplify expari(). Reviewed by: jilles
* Fix socket calls on error post-r243965.kevlo2012-12-211-1/+1
| | | | Submitted by: Garrett Cooper
* More -Wmissing-variable-declarations fixes.ed2012-10-192-2/+2
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* Rework all non-contributed files that use `struct timezone'.ed2012-09-011-4/+4
| | | | | | | | | | | | | | This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
* Explain that setting an absolute day value can fail and that the month shouldbrian2010-06-041-3/+11
| | | | | | | | | | usually be set first when using -v. Adjust an example that sets the day to 30 before setting the month to 3 in accordance with this approach as the example would always fail in February! PR: 147354 MFC after: 2 weeks
* Remove stale references to utmp(5) and its corresponding filenames.ed2010-01-211-2/+2
| | | | I removed utmp and its manpage, but not other manpages referring to it.
* Port everything in bin/ from utmp to utmpx.ed2010-01-132-4/+1
| | | | | date: use libc utmpx routines instead of the ones provided by libulog. pax: don't depend on <utmp.h>
* Let date(1) use utmpx instead of logwtmp().ed2009-12-052-5/+11
| | | | | utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for the same purpose as how we call logwtmp() here.
* Don't reset DST computed by strptime() (when e.g. setting theru2008-02-071-6/+3
| | | | | | | date via -f %s). Reported by: Eugene Grosbein Diagnosed by: Miguel Lopes Santos Ramos
* Correct the referenced securelevel document, it's now securelevel 7.remko2007-06-021-2/+2
| | | | Pointed out by: ru
* Use strlcpy in place of strncpy + setting the last character NUL. Toimp2006-08-201-2/+2
| | | | be safe, memset the entire msg to '0'.
* -mdoc sweep.ru2005-11-171-6/+1
|
* Note which options are not part of the standards.trhodes2005-11-011-1/+12
| | | | | | | Xref locale(1) and bump document date. Reviewed by: keramida No Objections: -standards
* Expand *n't contractions.ru2005-02-131-1/+1
|
* Add the new standard EXIT STATUS section where appropriate.ru2005-01-161-38/+38
| | | | Sort standard sections in the (documented) preferred order.
* /*- or .\"- or #- to begin license clauses.imp2005-01-102-1/+2
|
* Scheduled mdoc(7) sweep.ru2005-01-091-2/+2
|
* Change the behaviour of `-v' so that, e.g., stepping a month backyar2004-08-092-1/+30
| | | | | | | | | | | | | | | | | on March 31 won't take you to March 2 or 3 (now the result will be the last day of February.) In general, now stepping by months from the last days of the current month A will take you to the very last day of the target month B if B is shorter than A. The previous version would just step to March 31 and rely on mktime(3) to correct the date. Despite its simplicity, such way was counter-intuitive to users and caused pain to shell script writers. Noticed by: Igor Timkin <ivt at gamma dot ru> Approved by: brian MFC after: 2 weeks
* Give the most awesome example of how to parse the output of datealfred2004-07-171-0/+8
| | | | | | back into epoch time. Everytime I'm asked to do this by someone I have to spend about ten minutes recreating the same command line. So record it under examples.
* Deal with double whitespace.ru2004-07-031-3/+5
|
* Mechanically kill hard sentence breaks.ru2004-07-021-1/+1
|
* DESCRIPTION was not updated for the new SYNOPSIS.ru2004-05-161-6/+7
|
* Give date(1) a much better SYNOPSIS section which is useful as more thangreen2004-04-061-9/+13
| | | | | | | decoration. Further improvements are welcome, but at least this is a separate of the various modes of operation date has, as well as sectioning off the two deprecated options for settimeofday(tz) that don't even apply to actual operation of date as such, anyway.
* Remove clause 3 from the UCB licenses.markm2004-04-064-16/+0
| | | | OK'ed by: imp, core
* Rev. 1.32 moved a comment to the wrong line. The hack refered tomtm2004-03-041-2/+2
| | | | | | | | | | in the comment applies to a decision that needs to be made in relation to the year 2000. In fact, that statement probably should be changed to be more generic (getting the year from the current time perhaps). Otherwise, starting in 2069 two digit year conversions in date(1) will start assuming 1900 instead of 2000. hehe.
* Note the Linux required format.obrien2004-01-061-0/+1
|
* Check for write errors; report and exit with error value.dds2003-10-041-0/+2
|
* Get this area compiling with the highest WARNS= that it works with.markm2003-06-131-2/+0
| | | | | | | Obsolete WFORMAT= junk also removed where possible. OK'ed by: obrien Tested on: sparc64, alpha, i386
* mdoc(7) police: markup laundry.ru2003-02-231-31/+22
|
* Add an example to help one manually set the date on one machine taking the outobrien2003-02-181-0/+5
| | | | put from another.
* Enclose sccsid according to style(9).charnier2003-02-052-5/+7
| | | | udp/timed -> timed/udp
* Staticify for lint.markm2002-10-181-2/+2
|
* Fix some twelve hour clock braindamage. The range for hours is 0-23 not 1-12.fanf2002-10-031-1/+1
| | | | MFC After: 1 week
* Consistently use __FBSDIDobrien2002-06-303-9/+6
|
* Use socklen_t for the length of a socket structure instead of `int'.keramida2002-06-091-1/+2
| | | | Reviewed by: mike
* s/CMOS/hardware as talked about on cvs-committers.trhodes2002-04-161-1/+1
| | | | | | Suggested by: sheldonh Approved by: bde MFC after: 1 day
* Little nit pick in date(1) manual page, tell users which clock date(1)trhodes2002-04-151-0/+6
| | | | | | sets PR: 35606
* Fix warnings inspired by lint, a commercial lint and WARNS=4.markm2002-02-223-20/+21
|
* Lock down with WFORMAT=1 except those directories with unfixed warnings.kris2002-02-041-0/+1
| | | | Tested on i386 and alpha.
* o __P has been reovedimp2002-02-023-17/+11
| | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Approved by: arch@, new style(9)
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyobrien2001-12-041-0/+1
| | | | | | set WARNS=0. Reviewed by: mike
* Remove assumption that time_t is an intdillon2001-10-281-1/+3
| | | | MFC after: 1 day
* mdoc(7) police:ru2001-08-071-15/+11
| | | | | | | Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text. Not only this slows down the mdoc(7) processing significantly, but it also has an undesired (in this case) effect of disabling hyphenation within the entire enclosed block.
* Remove whitespace at EOL.dd2001-07-151-3/+3
|
* Simplify, with the power of new mdoc(7).ru2001-06-091-9/+3
|
* Add -j to the usage string.dd2001-06-091-1/+1
| | | | | PR: 27986 Submitted by: Cyrille Lefevre <clefevre@redirect.to>
OpenPOWER on IntegriCloud