History log of /freebsd-10.1-release/usr.bin/cmp/regular.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 223376 21-Jun-2011 delphij

Eliminate unneeded headers.


# 216370 11-Dec-2010 joel

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


# 200462 13-Dec-2009 delphij

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


# 200420 11-Dec-2009 delphij

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

Tested with: make universe


# 180426 10-Jul-2008 charnier

add __unused to succeed at WARNS=6


# 111538 26-Feb-2003 das

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)


# 100815 28-Jul-2002 dwmalone

ANSIify function definitions to avoid a warning.


# 92920 21-Mar-2002 imp

remove __P


# 87628 10-Dec-2001 dwmalone

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.


# 87282 03-Dec-2001 dwmalone

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


# 87241 02-Dec-2001 markm

Turn on WARNS=2.
Use __FBSDID().


# 86099 05-Nov-2001 dwmalone

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

Reviewed by: cmp


# 86044 04-Nov-2001 dwmalone

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


# 61883 20-Jun-2000 green

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


# 60586 15-May-2000 phk

Oops, byte offset was as off_t.


# 60583 15-May-2000 phk

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


# 49235 29-Jul-1999 green

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


# 46081 25-Apr-1999 imp

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


# 41568 06-Dec-1998 archie

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


# 21786 16-Jan-1997 alex

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


# 21429 08-Jan-1997 joerg

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.


# 20312 11-Dec-1996 dyson

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.


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources