Commit Graph

12364 Commits

Author SHA1 Message Date
araujo
9efe3d2c86 Use MIN() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-27 02:13:57 +00:00
araujo
d814d9ecde Use MIN() instead of MAX() as the previous syntax was wrote in a weird and
confused way: "prec > 9 ? 9 : prec".

Submitted by:	pfg, ngie and luke <luke.tw@gmail.com>
MFC after:	2 weeks.
2016-04-26 00:29:00 +00:00
fanf
28d7dd9b8b Example RIPE whois query with options and spaces.
Since it is used in the example, mention the -- option in the synopsis
even though it is a universal standard, and tweak to fit it on one line.
2016-04-25 15:46:42 +00:00
bz
8f86ed9783 Try to make gcc builds happy again by removing a redundant declaration. 2016-04-25 13:20:35 +00:00
pfg
7b1878186b Adjust a type from r267490.
Independent of the maximum length, the return type for strnlen(3)
is always size_t.
2016-04-24 04:28:04 +00:00
pfg
81085e95f4 patch(1): avoid signed integer overflow when debugging.
Integer i is used to index p_end of type LINENUM (actually long).

Match the types.

MFC after:	5 days
2016-04-24 04:08:36 +00:00
sobomax
0b911c8b6b GC duplicate define. 2016-04-23 07:28:32 +00:00
sobomax
5be3733785 Improve performance in a few key areas:
o Split the compression across several worker threads. By default, "several"
   matches number of CPUs, capped at 24 for sanity when running on a very big
   hardwares. Provide option to set that number manually;

 o Fix bug inherited from the mkulzma (R.I.P) which degraded already slow LZMA
   compression even further by calling function to release compression state
   after processing each block.

   It is neither documented as required nor actually required by the LZMA
   library. This caused spree of system calls to release memory and then map
   it again for every block. LZMA compression is more than 2x faster after this
   change alone;

 o Record time it takes to do compression and report throughput achieved.

 o Add simple first-level 256 entry hash table for de-dup code, so it's not
   becoming a bottleneck at big files.
2016-04-23 07:23:43 +00:00
araujo
c81163a574 Use roundup2() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-22 06:23:23 +00:00
araujo
7f164828e7 Use MIN() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:46:57 +00:00
araujo
e15ebdf90e Use macro MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:43:06 +00:00
araujo
244576d3c3 Use macro MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:37:27 +00:00
pfg
3f525b8a34 kernel: use our nitems() macro when it is available through param.h.
No functional change, only trivial cases are done in this sweep,

Discussed in:	freebsd-current
2016-04-21 21:30:51 +00:00
emaste
55c6dd3879 elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree
It's provided by sys.mk so there's no need to derive it from ${.CURDIR}.

Suggested by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5998
2016-04-21 12:58:29 +00:00
eadler
242400036c Bring a little more compability with GNU units 2.12
- notionally support a 'history file' flag. This doesn't do much now,
  but is there to prevent scripts written against GNU units from
  breaking
- correctly gracefully quit rather than exit (this will make it easier
  to support a history file in the future)
- remove the "t" flag from fopen which was there to support windows. We
  have not supported windows since at the latest, the introduction of
  capsicum.
2016-04-21 05:24:47 +00:00
bapt
f3bbb3cf24 Plug memory leaks
Reported by:	Coverity
CID=		1338535, 1338536, 1338542, 1338569, 1338570
2016-04-20 21:23:42 +00:00
bapt
d0f2726865 Fix bad checking of the return of realloc(3)
Reported by:	Coverity
CID:		1007335
MFC after:	3 days
2016-04-20 20:56:06 +00:00
bapt
499f728f92 Fix typo: actually test the return of strchr(3)
Reported by:	Coverity
CID:		1007335
MFC after:	3 days
2016-04-20 20:54:47 +00:00
araujo
5329b494a9 Partially revert the change on r298325 where there is an
(-1) casted to a pointer.

Submitted by:	pfg
MFC after:	2 weeks.
2016-04-20 01:38:54 +00:00
araujo
a05218e04b Use NULL instead of 0 for pointers.
Small cosmetic change.

MFC after:	2 weeks.
2016-04-20 01:28:31 +00:00
araujo
b9140f06e3 Use NULL instead of 0 for pointers.
gethostbyname(3) will return NULL for error status.

MFC after:	2 weeks.
2016-04-20 01:26:03 +00:00
delphij
9454d2f01e Fix build breakage introduced by r298253. 2016-04-19 07:28:39 +00:00
eadler
bf4d4b4498 Rename units.lib -> definitions.units
- this matches GNU units 2.12
add ISO country codes from units 2.12
2016-04-19 05:17:59 +00:00
eadler
5ebf5daae9 Remove pathnames.h
- it only holds a single constant
- it doesn't exist in the GNU variant
2016-04-19 05:04:39 +00:00
araujo
30f25483fe Use NULL instead of 0 for pointers.
realloc will return NULL in case it cannot allocate memory.

MFC after:	2 weeks.
2016-04-19 02:05:32 +00:00
araujo
889ed0c7e4 Use NULL instead of 0 for pointers.
strchr(3) will return NULL if the character does not appear in the
string.

MFC after:	2 weeks.
2016-04-18 14:44:01 +00:00
emaste
60b9a17328 Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain
This produces a nicer path in debug info and build logs.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-04-18 13:13:59 +00:00
araujo
cb410646fd User NULL instead of 0 for pointers.
getservent(3) returns NULL on EOF or error.

MFC after:	2 weeks.
2016-04-18 07:14:01 +00:00
araujo
45973d9d15 Use NULL instead of 0 for pointers.
fopen(3) will return NULL in case it cannot open the STREAM.

MFC after:	2 weeks.
2016-04-18 07:09:34 +00:00
araujo
b2f244e71e Use NULL instead of 0 for pointers.
MFC after:	2 weeks.
2016-04-18 07:05:18 +00:00
araujo
a32949ae45 Use NULL instead of 0 for pointers.
realloc will return NULL if it cannot allocate memory.

MFC after:	2 weeks.
2016-04-18 06:12:00 +00:00
araujo
76c4083741 Use NULL for pointers.
strrchr(3) will return NULL if the character does not appears in
the string.

MFC after:	2 weeks.
2016-04-18 06:02:26 +00:00
araujo
d2d25bb0ca Use NULL instead of 0 for pointers.
Also malloc will return NULL if it cannot allocate memory.

MFC after:	2 weeks.
2016-04-18 05:46:18 +00:00
araujo
0bd7ac2f20 Use NULL instead of 0.
strtok(3) will return NULL when no more tokens remain.

MFC after:	2 weeks.
2016-04-18 05:26:32 +00:00
bapt
2f359d8f3e Note that mklocale(1) and colldef(1) are no longer used
mklocale and colldef has been replaced by localedef, but they have to be kept
until 10.2 is EOL for mklocale (it has been added to 10.3 as a bootstrap tools)
and until 10.3 is EOL for colldef (it has never been added to bootstrap tools)
2016-04-17 23:02:49 +00:00
bapt
b519ca02d7 Use the nitems() macro 2016-04-17 22:42:48 +00:00
jilles
8156bf7454 mail: Don't truncate mtime of mailbox to microseconds. 2016-04-17 20:00:24 +00:00
bapt
13b4b9515d Fix a mandoc -Tlint warning 2016-04-16 12:49:26 +00:00
bapt
79d8dcdb25 Directly set the O_CLOEXEC flags via the open(2) attributes
MFC after:	1 week
2016-04-16 12:47:23 +00:00
gjb
6549ef7d12 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-16 02:32:12 +00:00
pfg
26c891f034 Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
bdrewery
b40d5fe0a7 META_MODE: Don't rebuild build-tools targets during normal build.
This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build.  Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:06:10 +00:00
gjb
cad5e8d3bc MFH
Sponsored by:	The FreeBSD Foundation
2016-04-13 02:04:09 +00:00
pfg
5c3b3f706f fmt(1): for pointers use NULL instead of 0
While here clean excessive not lint comment indentation.
2016-04-13 01:57:06 +00:00
pfg
767e032691 fmt(1): reformat with indent(1).
Failed attempt to get nearer to style(9) and the format from the
original OpenBSD code. At least it should be readable now.

No functional change.
2016-04-13 01:46:48 +00:00
cem
f1b3ba4c0d Add a small tool, resizewin(1), to query terminal for window size
Submitted by:	Daniel O'Connor
Reviewed by:	kan, wblock, cem
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4438
2016-04-13 00:30:42 +00:00
gjb
e0e3598ce1 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-11 15:24:59 +00:00
bofh
1485828b08 Add bofh@ in calendar.freebsd 2016-04-10 16:48:21 +00:00
fanf
3389187e4b Handle whois referrals between RIRs
This is rather ugly, because the RIPE and APNIC whois servers do
not provide referrals for address blocks that they do not manage.
However ARIN is usually the right place or knows the right place
so we try there.

The particular instance which clued me in to this bug is U.Mich.
141.211.0.0/16 for which the referral chain should be IANA ->
RIPE -> ARIN. RIPE's RDAP does provide useful redirects (for
example try `curl -I http://rdap.db.ripe.net/ip/141.211.0.0)
so maybe their whois server can be improved.

AfriNIC's whois server gives more direct referrals, but they are
designed to be human-readable. Ugly, but we can manage.

The issue of referrals between RIRs is likely to become more important
in the future whith the increasing number of cross-region IP address
block transfers increases.
2016-04-08 11:43:22 +00:00
gahr
eb925cdf00 Enhance uuencode with a -r option to produce raw output.
This matches with uudecode's -r option to decode raw data without initial and
final framing lines.

$ echo Test | uuencode -mr - | uudecode -mr
Test

Approved by:	cognet
MFC after:		1 week
2016-04-07 16:12:38 +00:00