aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/patch.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-08-08 16:06:24 -0500
committerRob Landley <rob@landley.net>2015-08-08 16:06:24 -0500
commit5fb2766a9b51ee326a14ec9909066b20a2bfa9ac (patch)
treecde439ad83b28f92ba9976c189b9eb20ea5a0bbb /toys/posix/patch.c
parent400dacdeb69bc13868a625fc2ce8b49b6acd5ae3 (diff)
downloadtoybox-5fb2766a9b51ee326a14ec9909066b20a2bfa9ac.tar.gz
Teach date @unixtime[.fraction], switch -s to be -D (matching busybox and
not stomping on gnu's "an extra argument tells it to set the time so let's add -s to do the same thing" extension). Nanoseconds aren't uniformly supported by these apis, so had to stick it in GLOBALS() and pull it out later. Awkward, open to suggestions for a better way. (Also, the setting API is microseconds, not nanoseconds. Collect nano, convert to micro so we can switch APIs later without changing date's external UI again.) Oh, and shrink really_long_name_mktime() with a for() loop (and rename it) although I may go back and redo that for portability to hypothetical libraries if I can convert this mess to struct timespec with proper nanoseconds support. But that needs an extended strptime() which needs an extended struct tm, and between us and that is convincing posix computers got fast enough to care about fractions of a second. (Yes, I'm aware gnu added %N to date without adding it to strptime, implying they reimplemented strptime longhand inside date. I'm not doing that.)
Diffstat (limited to 'toys/posix/patch.c')
0 files changed, 0 insertions, 0 deletions