History log of /freebsd-current/usr.bin/cmp/regular.c
Revision Date Author Comments
# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 6673a547 30-Jan-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

cmp: Print a summary on SIGINFO.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38280


# f66b9b40 22-Sep-2021 Kyle Evans <kevans@FreeBSD.org>

cmp: add -b, --print-bytes

This is compatible with GNU cmp.

Reviewed by: bapt, markj (earlier version)
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D32074


# 4e380e84 22-Sep-2021 Kyle Evans <kevans@FreeBSD.org>

cmp: add -n, --bytes to limit number of bytes to compare

This is compatible with GNU cmp.

Reviewed by: markj
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D32072


# 2528b7e2 25-Feb-2019 Mark Johnston <markj@FreeBSD.org>

Fix handling of rights on stdio streams, take two.

Split the rights-limiting code into two cases: if one of the input
files isn't a regular file, use caph_limit_stream(3) instead of
open-coding the same logic; if both input files are regular files,
and the initial attempts to map them succeed, we limit the rights on
those files to CAP_MMAP_R.

Add a regression test for PR 234885.

PR: 234885
Reviewed by: delphij
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19216


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 71024a97 21-Jun-2011 Xin LI <delphij@FreeBSD.org>

Eliminate unneeded headers.


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 821df508 12-Dec-2009 Xin LI <delphij@FreeBSD.org>

Revert most part of 200420 as requested, as more review and polish is
needed.


# 6f2d3221 11-Dec-2009 Xin LI <delphij@FreeBSD.org>

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# dd999839 10-Jul-2008 Philippe Charnier <charnier@FreeBSD.org>

add __unused to succeed at WARNS=6


# d4890512 25-Feb-2003 David Schultz <das@FreeBSD.org>

The cmp utility has the questionable feature of using mmap when
comparing regular files. Add a SIGSEGV handler to make its
behavior less surprising when a read error occurs. The handler
does not attempt to distinguish errors from file truncation, but
anyone actively modifying a file while trying to compare it
shouldn't even expect something sane to happen.

PR: 45391
Reviewed by: mike (mentor)


# f2e8e0da 28-Jul-2002 David Malone <dwmalone@FreeBSD.org>

ANSIify function definitions to avoid a warning.


# f1bb2cd2 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

remove __P


# 9f5b04e9 10-Dec-2001 David Malone <dwmalone@FreeBSD.org>

Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.


# 5748d9ba 03-Dec-2001 David Malone <dwmalone@FreeBSD.org>

Cast off_t to long long before printing. Use %ll instead of %q incase
long long and quad_t are not the same.


# 6af414cb 02-Dec-2001 Mark Murray <markm@FreeBSD.org>

Turn on WARNS=2.
Use __FBSDID().


# c5250ed1 05-Nov-2001 David Malone <dwmalone@FreeBSD.org>

Make filenames const to avoid a few warnings.
Add FreeBSD tags.

Reviewed by: cmp


# 60b49f05 04-Nov-2001 David Malone <dwmalone@FreeBSD.org>

Make cmp work by mmapping chunks of a file, rather than the whole
file at one time.

PR: 24732
Submitted by: Andrew L. Neporada <andr@dgap.mipt.ru>
MFC after: 2 weeks


# 84ad3d8f 20-Jun-2000 Brian Feldman <green@FreeBSD.org>

Make cmp -s work properly if skip values are given. Also, exit(1)
is now exit(DIFF_EXIT).

PR: 18597
Submitted by: Anatoly Vorobey <mellon@pobox.com>
Committed at: Usenix terminal room


# 78cb0ab4 15-May-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Oops, byte offset was as off_t.


# e03983a3 15-May-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Let cmp(1) grow in -x option to print differences in contemporarry hex
format rather than the mixed decimal/octal format of -l.


# ac022265 29-Jul-1999 Brian Feldman <green@FreeBSD.org>

Fix improper mmap length paramater which can result in improper behavior
or cmp crashing in specific cases.


# 96846ff6 25-Apr-1999 Warner Losh <imp@FreeBSD.org>

More egcs warning fixes:
o main returns int not void
o use return 0 at end of main when needed
o use braces to avoid potentially ambiguous else
o don't default to type int
o #ifdef 0 -> #if 0

Reviewed by: obrien and chuckr


# fa146c53 06-Dec-1998 Archie Cobbs <archie@FreeBSD.org>

Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]).


# 8abdc2eb 16-Jan-1997 Alexander Langer <alex@FreeBSD.org>

Sweep through the tree fixing mmap() usage:

- Use MAP_FAILED instead of the constant -1 to indicate
failure (required by POSIX).
- Removed flag arguments of '0' (required by POSIX).
- Fixed code which expected an error return of 0.
- Fixed code which thought any address with the high bit set
was an error.
- Check for failure where no checks were present.

Discussed with: bde


# c28065c6 07-Jan-1997 Joerg Wunsch <joerg@FreeBSD.org>

Our mmap(2) has a limitation where the `offset' parameter must be
page-aligned. cmp(1) should know about this flaw, and work around it.

While i was at it, fixed an uninitialized variable as reported by
-Wall.


# 2ae09ad8 10-Dec-1996 John Dyson <dyson@FreeBSD.org>

When mmap is used, do an madvise(MADV_SEQUENTIAL) to make things
go much more quickly when file input is really done. Of course, the
fully cached case will make no difference.


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources