Commit Graph

580 Commits

Author SHA1 Message Date
msaitoh
ba5c90c4a4 s/sucess/success/ in comment. 2019-12-27 09:45:26 +00:00
wiz
ec6e765cf3 Remove trailing whitespace. 2019-12-07 12:47:07 +00:00
christos
95fb71b3fc Correct the man page, and say that the printf(3) format characters need
to be uintmax_t.
2019-12-06 19:31:52 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
christos
bfdd69f658 -Wstringop-truncation is only gcc. 2019-10-08 18:50:34 +00:00
christos
573d865676 Ignore strncpy(foo, bar, sizeof(foo)) for the wtmp fields where we don't
want NUL termination. We can't use pragma's because the old gcc complains
about the new warnings it does not understand.
2019-10-04 00:03:56 +00:00
tnn
00bf802c59 annotate __dead 2019-10-03 20:29:19 +00:00
christos
5c84fc8d45 provide a default error function instead of trying to cast exit(3). 2019-10-03 18:12:44 +00:00
brad
c59f01cb01 Teach getdiskrawname and getdiskcookedname about zvols.
Reviewed by Christos
2019-08-22 20:23:43 +00:00
kre
63e182f423 snprintb(3) says that, in the new(?) Torek format, all fields specs end with \0
The F spec is one of those, it should be terminated with \0 just like all
the others (irrelevant that it has no extra data to delimit).

Fix <sys/mman.h> to define the snprintb() format string correctly (include
the missing \0's).   Fix the copy of that definition included into
snprintb(3) to match the updated mman.h version (ride the date bump
from the day before yesterday .. this is the same change, just corrected).

Undo the previous snprintb.c change ("off by one" fix) which was an
attempt to make the broken mman.h usage work (and did, but not the way
it should be done).   Also, after using the new * format (instead of only
when something has already matched) skip the associated data so we don't
attempt to interpret it as more field specifiers.  This func needs lots of TLC!

Fix the ATF tests for snprintb() to not assume that F format is really
exactly like f format, and has data after the field specifier.  It doesn't.
Add several more tests (including testing the '*' field operator
recently added).
2019-04-29 07:55:38 +00:00
wiz
fa9ca235d8 Remove trailing whitespace. 2019-04-27 17:58:51 +00:00
christos
1d8a803c77 remove dup line 2019-04-27 17:48:13 +00:00
christos
ca3496f0f1 Document the '*' field and give a more complex example with F and *. 2019-04-27 17:46:08 +00:00
msaitoh
c2f2b1bf58 s/ the the / the / 2019-03-08 08:12:39 +00:00
alnsn
f4bc8af01c Document "ROOT." syntax before documenting a generic . 2018-12-28 18:44:11 +00:00
alnsn
a2fe1bd34b No need to quadruple a buffer because strunvis(3) doesn't expand. 2018-12-27 21:35:48 +00:00
christos
e0a9077d02 use the right type. 2018-10-06 23:48:00 +00:00
jmcneill
51976c5c14 If fs_spec starts with the special string "ROOT.", replace it with a device
path derived from the value of the kern.root_device sysctl.
2018-10-06 13:09:53 +00:00
kamil
171790efcf Fix stack use after scope in libutil/pty
The pt variable's elements are used after the end of the pt scope.
A move of pt to outer scope fixes this.

Detected with MKSANITIZER/ASan with tmux(1), a forkpty(3) user.
2018-06-24 09:30:26 +00:00
kamil
b2b644497e Prevent underflow buffer read in trim_whitespace() in libutil/passwd.c
If a string is empty or contains only white characters, the algorithm of
removal of white characters at the end of the passed string will read
buffer at index -1 and keep iterating backward.

Detected with MKSANITIZER/ASan when executing passwd(1).
2018-06-24 01:53:14 +00:00
wiz
349b123f81 Use mdoc macros. 2018-04-05 11:07:00 +00:00
kre
deb0051437 Document opendisk1() - it has been around long enough.
(pity about the name...)

XXX pullup-8
2018-04-04 04:43:46 +00:00
wiz
3faa539e67 Sort errors. 2017-10-23 01:05:10 +00:00
abhinav
75bd3393d3 Add snprintb_m to the NAME section. 2017-10-22 16:59:18 +00:00
abhinav
d4ec480093 Add missing functions to the NAME section 2017-10-22 16:55:32 +00:00
wiz
01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
kamil
2d1839db7f Stop including <sys/user.h> in userland libraries
This header in this context is freebsdism.
2017-06-14 12:24:51 +00:00
abhinav
9f9499a40c Add man page links for:
EV_SET to kqueue(2)
   getmntoptstr, getmntoptnum, freemntopts to getmntopts(3)

Reviewed by wiz@
2017-04-01 14:31:05 +00:00
abhinav
ad5244b4e8 Use Sy to highlight the table header. 2017-03-30 20:00:21 +00:00
abhinav
1bf28fdbff Add missing functions 2017-03-30 19:56:36 +00:00
abhinav
33d7e92834 Add getmntoptstr, getmntoptnum, and freemntopts to the NAME section
Fix couple of sentences

getmntoptstr, getmntoptnum, and freemntopts need to be linked to the getmntopts(3)
man page as well. Will do in a later commit after doing a relase build test.
2017-03-30 19:41:41 +00:00
abhinav
cd4acf025e Add getdiskcookedname to the NAME section
Fix couple of typos.
2017-03-30 19:23:06 +00:00
kre
de1e0dfd01 parsedate.y: meaningless KNF of a comment (no code changes)
parsedate.3:  add an item in BUGS noting the weirdness of "next"

The real purpose of this commit is to supply the following message
which should be used for the immediately previous commit, replacing
its commit message (the two are similar, but definitely not the
same).   With thanks to gdt@ for pointing out one of the (many) errors
in the previous message (and noting others I had already seen).

    ----

Make parsedate handle "12 noon" and "12 midnight" (including when the
time given is "12:00" or "12:00:00") - but only for exactly 12 o'clock.
"12:00:01" is am or pm, not noon or midnight.

"12 am" remains as an alias for "12 midnight", and "12 pm" for noon,
though both are strictly (pedanticly) invalid (and meaningless.)

Note that "12 midnight" (or "12 am") means 00:00:00 (ie: midnight at
the start of the day, not at the end.)
2017-03-22 18:17:42 +00:00
kre
e9cfba3947 Make parsedate handle "12 noon" and "12 midnight" (including when
the time is "12:00" or "12:00:00) - but only for exactly 12 o'clock.
"12:00:01" is am or pm, not noon or midnight.

"12 am" remains as an alias for "12 midnight", and "12 pm" for midnight,
though both are strictly invalid (and meaningless.)

Note that "12 pm" means 00:00:00 (ie: midnight at the start of the
day, not at the end.)
2017-03-22 01:49:36 +00:00
kre
b717517d3c Fix PR lib/52101 -- 12:30 am is 00:30:00 and 12:30 pm is 12:30:00 2017-03-22 00:59:06 +00:00
snj
e6059b4b0a new lookup order will be in 7.1 before 8.0 2017-01-29 05:13:55 +00:00
christos
5d7e998696 Make this portable to other OSs 2016-12-29 18:30:55 +00:00
abhinav
93864c5433 Complete a sentence
and replace full stop with a comma at one place as the sentence wasn't finished
2016-12-23 06:01:41 +00:00
kre
0a924e39aa Remove dawn/sunup/sunset/sundown (sunrise was never there...)
If 06:00 or 18:00 are wanted, just say "06:00" (etc).  If these
are ever added back, they really should determine location, and
calculate actual sunrise/sunset times for the location and date.
That's not likely to happen...
2016-06-26 07:09:24 +00:00
wiz
cd42b3989a Fix typo. Sort errors. 2016-06-07 11:20:45 +00:00
christos
395941f2ce PR/51216: Instead of trying to open files in the current working
directory first for paths that don't contain "/", first try the
/dev paths to avoid confusion with files in the working directory
that happen to match disk names.
2016-06-06 17:50:19 +00:00
christos
f32209ed0d Use NULL instead of 0. 2016-06-01 22:58:52 +00:00
kre
3060c9b9b9 Make relative date changes ("+ 2 months") etc, work a little more sanely.
OK christos@
2016-05-03 18:14:54 +00:00
roy
67f77b27fc Removed botched debug left over. 2016-04-12 20:40:43 +00:00
roy
4b95ed965b Fix pidfile location path rules to match prior version. 2016-04-12 20:36:35 +00:00
wiz
16a8980036 Add serial commas. Fix minus. Sort SEE ALSO. Fix xref. 2016-04-11 08:49:57 +00:00
roy
aae35f25ba Bump libutil for new pidfile functions. 2016-04-11 08:44:40 +00:00
roy
6b9006e83c Implement pidfile_lock, pidfile_read and pidfile_clean.
Discussed on tech-net@, ok core@.
2016-04-10 19:05:50 +00:00
christos
ee5f11c12c pretty-print link addresses. 2016-04-06 18:04:58 +00:00
christos
e447d67050 prefer <sys/cpu.h> instead of <machine/cpu.h> 2016-01-25 18:14:04 +00:00