Commit Graph

12344 Commits

Author SHA1 Message Date
Conrad Meyer
a60711fd00 sdiff(1): Fix potential NULL deref in cleanup path
In the presence of the --diff-pid argument, it is possible for 'diffpipe' to be
NULL.  Only fclose() it if it was initialized.

Reported by:	Coverity
CID:		1355183
Sponsored by:	EMC / Isilon Storage Division
2016-05-10 20:09:40 +00:00
Pedro F. Giffuni
6351d60947 sed.1: Correction for the case insensitive case.
Use the capital I instead of the lowercase.

Submitted by:	Mikhail T.
PR:		195929
MFC after:	2 weeks
2016-05-10 17:01:51 +00:00
Baptiste Daroussin
68dd67a27b Rename getline with get_line to avoid collision with getline(3)
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard
2016-05-10 11:17:36 +00:00
Baptiste Daroussin
f03ef8405b Rename getline with get_line to avoid collision with getline(3)
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard
2016-05-10 11:12:31 +00:00
Baptiste Daroussin
a651f2bc6c Rename getline with get_line to avoid collision with getline(3)
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard

Obtained from:	NetBSD
2016-05-10 11:11:23 +00:00
Pedro F. Giffuni
11398c77da Revert r299279:
Simplify redundant malloc'ing in sed -e.

It is causing havoc in the ports tree:

===>  Configuring for wxsvg-1.5.7
sed: 1: "/gcc_dir=\\`/s/gcc /$CC /": bad flag in substitute command: '/'
*** Error code 1

===>  Patching for vips-8.3.1
sed: 1: "1s|^#![[:space:]]*/usr/ ...": bad flag in substitute command: 's'
*** Error code 1

PR:		195929
Reported by:	danilo
2016-05-10 02:02:50 +00:00
Bryan Drewery
29df9f6b75 DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools.
This avoids running target binaries.

Sponsored by:	EMC / Isilon Storage Division
2016-05-09 22:21:09 +00:00
Baptiste Daroussin
fe5870b6c7 Rationalize license numbering 2016-05-09 20:55:35 +00:00
Baptiste Daroussin
d819303ada Some style(9) fixes
No functional changes

Obtained from:	OpenBSD
2016-05-09 20:55:00 +00:00
Ben Woods
8dd5aa946f Add myself (woodsb02) to the calendar.freebsd file
Approved by:	adamw (mentor)
Differential Revision:	https://reviews.freebsd.org/D6276
2016-05-09 20:21:49 +00:00
Pedro F. Giffuni
d74b9e1311 Simplify redundant malloc'ing in sed -e.
When encountering an -e argument, sed currently mallocs a string to COPY
the optarg -- with '\n' appended. The appendage does not seem necessary --
indeed, the same call to add_compunit processing the sole command (given
without -e) passes the *argv verbatim: without making a copy, and without
appending newline.

This matches what is done in other BSDs.

Submitted by:	Mikhail T.
PR:		195929
MFC after:	2 weeks
2016-05-09 18:53:46 +00:00
Jilles Tjoelker
1f9b8f8e0d install: Add some tests. 2016-05-08 21:11:24 +00:00
Baptiste Daroussin
dbc0cf500d Only one program is build in usr.bin/sdiff use the right include 2016-05-07 20:23:26 +00:00
Baptiste Daroussin
1ddda798a6 Revert r299218 VISUAL is actually a perfecly valid env to specify an editor 2016-05-07 18:58:07 +00:00
Baptiste Daroussin
041db57684 Only use EDITOR as a variable to specify which text editor to use 2016-05-07 18:48:48 +00:00
Baptiste Daroussin
15eaa1aea0 Directly call the editor if needed instead of spawning /bin/sh 2016-05-07 18:44:30 +00:00
Baptiste Daroussin
0c4ac56e16 Replace fparseln(3) with getline(3)
It removes a dependency on libutil.
2016-05-07 18:21:58 +00:00
Pedro F. Giffuni
b6f5aa5715 sed: rewrite the main loop.
Rewrite the main loop of the "sed s/..." command, shortening it by ten
lines and simplifying it by removing the switch statement implementing
/g, /1, and /2 separately and repetitively.

This will be needed to bring a fix from OpenBSD later.

Obtained from:	OpenBSD (schwarze CVS Rev. 1.18)
MFC after:	3 weeks
2016-05-07 01:44:22 +00:00
Edward Tomasz Napierala
b0b3f0e152 Add the "-r" flag to iscsictl(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-06 13:45:42 +00:00
Edward Tomasz Napierala
6735d50255 Document the "Protocol" field of iscsi.conf(5).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-06 13:44:56 +00:00
Enji Cooper
430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Bryan Drewery
0252c68ba4 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-05-04 03:14:34 +00:00
Baptiste Daroussin
eebea334c4 Print the fchmodat mode in human readable fashion
MFC after:	1 week
2016-05-03 21:27:17 +00:00
Bjoern A. Zeeb
e29c552990 fgetc returns an int not a char.
Found by:   powerpc builds failing due to comparing with EOF raised:
"comparison is always false due to limited range of data type"
2016-05-02 15:07:43 +00:00
Pedro F. Giffuni
af7ca7c85d usr.bin: minor spelling fixes on comments.
No functional change.
2016-05-01 16:13:05 +00:00
Pedro F. Giffuni
fcc7baa1ae localedef(1): minor spelling fixes on comments.
No functional change.
2016-05-01 16:10:56 +00:00
Ed Schouten
e33d251e8e Remove useless calls to basename().
There are a couple of places in the source three where we call
basename() on constant strings. This is bad, because the prototype
standardized by POSIX allows the implementation to use its argument as a
storage buffer.

This change eliminates some of these unportable calls to basename() in
cases where it was only added for cosmetical reasons, namely to trim
argv[0]. There's nothing wrong with setting argv[0] to the full path.

Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D6093
2016-05-01 08:22:11 +00:00
Baptiste Daroussin
da5c2c4230 When checking for binary file, check if ch is not EOF only ch actually got
a value assigned

Reported by:	pfg
2016-04-30 14:48:30 +00:00
Dimitry Andric
4c4924e8b0 Update from subversion 1.9.2 to 1.9.4.
This contains only bug fixes, no new features.  The repository format is
also unchanged from 1.9.2.  Full list of changes between 1.9.4 and
earlier versions:

  https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES

Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and
CVE-2016-2168) do not affect the version of Subversion in the FreeBSD
base system, since neither SASL nor Apache modules are enabled.

Relnotes:	yes
MFC after:	2 weeks
2016-04-30 10:35:42 +00:00
Baptiste Daroussin
13b5b54865 import sdiff(1) from GSoC 2012
Import sdiff(1) from the diff version written by Raymond Lai,
improved during GSoC 2012 by Jesse Hagewood.

Compared to the version done in during that summer of code:
- Remove the zlib frontend: zsdiff
- Compatible output (column size and separators) with GNU sdiff

Compared to GNU sdiff in ports:
- The only difference is padding using spaces vs tabs

Compared to OpenBSD and NetBSD import:
- Implement missing options (including long options) from GNU sdiff
- Improved support for the edition mode (signal handling)
- Output visually compatible with GNU sdiff: size of columns

While here import regression tests from NetBSD adapted to fit the output as
expected by GNU sdiff

Reviewed by:	emaste (in part)
Obtained from:	OpenBSD, NetBSD, GSoC 2012
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5981
Differential Revision:	https://reviews.freebsd.org/D6032 (diff with NetBSD version)
Differential Revision:	https://reviews.freebsd.org/D6033 (diff with OpenBSD version)
2016-04-29 23:27:15 +00:00
Glen Barber
49dae58b28 Fix including Kyuafile in packaged base system.
Fix a related typo while here.

Note, this change results in the Kyuafile inclusion in the runtime
package, which needs to be fixed, however addresses the PR as far
as I can tell in my tests.

PR:		209114
Submitted by:	ngie
Sponsored by:	The FreeBSD Foundation
2016-04-29 05:28:40 +00:00
Pedro F. Giffuni
0b33b55b01 Small typo. 2016-04-28 15:20:08 +00:00
Marcelo Araujo
cd59e2f343 Use MIN() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-27 02:44:10 +00:00
Marcelo Araujo
a9a46bd918 Use MIN() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-27 02:34:25 +00:00
Marcelo Araujo
1e8b591f62 Use macro MIN() from sys/param.h.
MFC after:	2 weeks.
2016-04-27 02:26:31 +00:00
Marcelo Araujo
a301044615 Use MIN() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-27 02:13:57 +00:00
Marcelo Araujo
5d49c30c7b 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
Tony Finch
c37dc1fb0b 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
Bjoern A. Zeeb
d654df1365 Try to make gcc builds happy again by removing a redundant declaration. 2016-04-25 13:20:35 +00:00
Pedro F. Giffuni
3548708c47 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
Pedro F. Giffuni
2c4eed4723 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
Maxim Sobolev
96ad8686f6 GC duplicate define. 2016-04-23 07:28:32 +00:00
Maxim Sobolev
4fc55e3e46 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
Marcelo Araujo
61cfb5db60 Use roundup2() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-22 06:23:23 +00:00
Marcelo Araujo
ee03c16e64 Use MIN() macro from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:46:57 +00:00
Marcelo Araujo
cadc2836d8 Use macro MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:43:06 +00:00
Marcelo Araujo
fcc0131f63 Use macro MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:37:27 +00:00
Pedro F. Giffuni
e55a6575d9 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
Ed Maste
2821bdccaa 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
Eitan Adler
c706c470e4 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