Commit Graph

504 Commits

Author SHA1 Message Date
wiz
00e22b0153 Drop trailing whitespace. 2014-10-08 22:10:04 +00:00
apb
82cbb6b06d Improved handling of local times.
* A magic value USE_LOCAL_TIME (defined as 99999) may be passed as the
  Timezone to Convert(), instructing it to use mktime() to work
  in the local time zone, instead of using mktime_z to work in UTC
  (and then adding the specified timezone offset).
* Some old code is removed now that there's no need to find the local
  timezone offset.
* Allow either one or both of the now and zone arguments to
  parsedate() to be NULL, treating them independently.  Previously,
  if either one was NULL, the other was ignored.
* If the zone argument is specified, then the current date is calculated
  in the specified zone, not in local time.

Also add some disabled debug code.

This should fix PR lib/47916.
2014-10-08 17:38:28 +00:00
apb
8afaf3e03b The tzoff argument is in minutes (behind/west of UTC), not seconds.
While here, also say that time = NULL and tzoff = NULL are independent.
The code doesn't yet implement that, but it will soon.
2014-10-08 17:06:18 +00:00
apb
bb7c1cf124 Add a new non-terminal "time_numericzone" for a time with
a numeric timezone.  Move some productions from "time" to "time_numericzone".
Increment yyHaveZone when encountering one of these.

Previously, input of the form "HH:MM:SS +ZZZZ" would not have set the
yyhaveZone flag.
2014-10-08 14:43:48 +00:00
apb
7ab26473da A time like HH:MM:SS.sss says nothing about whether DST is on or off. 2014-10-08 14:32:29 +00:00
apb
ba5f5ce70d Document that years in ISO 8601 dates are taken literally.
"69-09-10" is in the year 69, not 2069.
2014-10-07 22:39:32 +00:00
apb
a777540768 Some years don't need the "maybe add 1900 or 2000" adjustment
that was designed for handling two-digit abbreviated years.
For example, "1/2/70" still refers to the year 1970, as before,
but "70-01-02" now refers to the year 70.

* Add a new yyHaveFullYear member to struct dateinfo, to record whether
  or not the year needs to be adjusted.
* Code that parses years sets yyHaveFullYear=1 if they know that the
  year should not be adjusted (as is the case for ISO 8601 dates), or if
  they perform their own adjustment (as is the case for CVS timestamps).
* Move the year adjustment code into a new function, AdjustYear,
  instead of inline in Convert().
* Make Convert() assume the year doesn't need to be adjusted,
  and make Convert's callers first call AdjustYear() if appropriate.
2014-10-07 22:27:14 +00:00
christos
c4dd2a8529 toolify opendisk 2014-09-29 21:04:52 +00:00
christos
7447c028c2 KNF, sign cast. 2014-09-17 23:54:42 +00:00
mlelstv
d144aaa341 use the passed parameter instead of PATH_MAX. Change signedness
of nlen.
2014-09-12 11:38:23 +00:00
mlelstv
26dae55653 - use a private buffer to resolve symlinks, the previous code was broken
- factored out symlink handling
- handle relative symlinks now
- handle device paths that do not contain a '/'.
2014-09-12 07:59:36 +00:00
christos
f8c3486fb6 fix param name 2014-08-18 07:33:21 +00:00
christos
8eb2e794a8 In COMPAT_DKWEDGE, attempt to open the label as specified in the NAME= entry.
This works for BSD disklabels, providing full compatibility. Merge some
duplicated code. This means that at least for BSD labels, we can handle
both pre and post- autodiscover kernels with the same fstab.
2014-05-25 13:46:07 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
mlelstv
8c51442d96 Use output buffer size to limit copy-out of sun_path. Otherwise you may
get a buffer overflow with strlcpy :)
2013-12-31 12:58:02 +00:00
mlelstv
1d339cd8f0 Resolve symlinks and cook the targets instead of the symlink names. 2013-12-22 14:31:51 +00:00
pgoyette
bd138fb723 Update example using hex-escape-sequences to conform to gcc parsing rules.
(See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33167 for details.)
2013-08-07 23:22:28 +00:00
pgoyette
2b1dd3a597 Add an example using snprintb_m()
Replace \*[Gt] and \*[Lt] with the simple characters > and < (OK wiz)

XXX Note that the examples currently do not compile with GCC!  The hex
XXX character sequences such as \x10CACHE are being parsed as longer
XXX than 2-hex-digit strings!
2013-08-07 22:51:59 +00:00
njoly
f2bb7e6625 Use <major>.<minor> for NetBSD version. 2013-07-22 12:36:56 +00:00
wiz
a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
yamt
006f500d6a add "maxthread" tunable to login.conf to adjust RLIMIT_NTHR.
PR/47626
ok'ed by christos
2013-06-29 04:52:55 +00:00
wiz
ac1c6f9496 Put code example on its own line, using Dl.
Ok christos
2013-06-23 08:38:41 +00:00
wiz
1125395d6b Punctuation nit.
(Shouldn't the whole line be .Dl or .Bl -literal instead?)
2013-06-21 08:18:24 +00:00
christos
d93337995d document login_getpwclass(3) 2013-06-20 20:42:30 +00:00
yamt
32786d7c5c fix timezone bugs in rev.1.11 and rev.1.13. PR/47916. 2013-06-12 01:46:07 +00:00
yamt
fbfa30e437 add rcsid 2013-06-12 01:31:24 +00:00
christos
59aa3006a2 Add a debugging format that prints all the fields with names. 2013-06-07 17:23:26 +00:00
wiz
2753405618 Use more markup. 2013-05-03 20:21:24 +00:00
matt
b1fc4bee02 Add getbyteorder() call. 2013-05-02 07:17:09 +00:00
apb
f653dad62b Document that errno may be used to distinguish between a
non-error result of -1 and an error.
2013-01-19 15:28:25 +00:00
apb
6b80497831 Distinguish between a non-error result of (time_t)-1 and an error result.
Modernise the test code inside #ifdef TEST.
2013-01-19 15:23:33 +00:00
apb
b156ae6a25 mktime(3) works in local time, and trying to trick it by
setting tm_gmtoff doesn't work.  Instead, call mktime_z(3)
with a null timezone (so it works in UTC) and adjust the
result afterwards.  Now "date -d @0" correctly
prints the local equivalent of 1970-01-01 00:00:00 UTC.
2013-01-19 09:27:32 +00:00
wiz
2dda5775d9 Sort sections. 2013-01-16 06:44:27 +00:00
christos
d035981822 add some things to add next time we modify the function 2013-01-15 22:42:14 +00:00
dsl
c672e5424a Don't rely on something including sys/ioctl.h for us. 2013-01-01 18:32:17 +00:00
dholland
cd3306d1ba Fix failure message for ecalloc. 2012-12-30 17:37:13 +00:00
dholland
1e653dd9c8 If malloc, calloc, or realloc returns NULL when a size of 0 was
requested, which is allowed by pertinent standards, honor it instead
of bombing.

Do not do this for calloc(x, y) where x != 0 && y != 0 but x*y == 0;
in that case bomb.
2012-12-30 17:36:00 +00:00
christos
82ad575716 don't include things you don't need 2012-11-04 13:08:56 +00:00
wiz
cd3709ae09 Fix string_to_flags prototype. From Brooks Davis in PR 46986.
Bump date.
2012-09-19 23:22:56 +00:00
joerg
ed602fb487 Don't use const foo const as type, one const is enough. 2012-09-13 21:44:49 +00:00
christos
7dab8608fa mention PATH_MAX instead of 16. 2012-07-27 21:33:46 +00:00
wiz
b713a39753 Remove trailing whitespace. 2012-07-27 18:22:04 +00:00
christos
eb537b13b6 Mention how big the name can be. 2012-07-23 02:21:14 +00:00
abs
9e66e6d75e Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
2012-06-25 22:32:43 +00:00
christos
ca7e8bb03f Fix compat code, so if we failed to make raw, return the regular path. 2012-04-08 20:56:12 +00:00
wiz
9a7b574b58 End sentence with dot. 2012-04-08 16:06:23 +00:00
christos
f3cbb49f84 Add and enable COMPAT_DKWEDGE which let's us autoconfigure wedges and boot
with a non-wedge aware fstab.
2012-04-07 17:10:02 +00:00
christos
1e9ca58635 - add getdiskrawname.
- exit on error for lint.
2012-04-07 16:44:39 +00:00
christos
8f3dcf00a8 fix typo 2012-04-07 16:22:42 +00:00
christos
4a87bdacc7 read returns ssize_t, and err is a function name. 2012-04-07 16:17:17 +00:00