From 5e166e5a1e6a1dd0bab8ad057ce66063f5abc8e1 Mon Sep 17 00:00:00 2001 From: Kiyoshi Aman Date: Tue, 28 May 2019 19:19:51 -0500 Subject: usr.bin/cmp: make buildable, remove nonstandard flag --- usr.bin/cmp/cmp.1 | 10 ---------- usr.bin/cmp/cmp.c | 29 +++++------------------------ usr.bin/cmp/extern.h | 6 +++--- usr.bin/cmp/misc.c | 9 --------- usr.bin/cmp/regular.c | 11 +---------- usr.bin/cmp/special.c | 9 --------- 6 files changed, 9 insertions(+), 65 deletions(-) (limited to 'usr.bin/cmp') diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 index e61f62c..e55d7c6 100644 --- a/usr.bin/cmp/cmp.1 +++ b/usr.bin/cmp/cmp.1 @@ -40,7 +40,6 @@ .Nd compare two files .Sh SYNOPSIS .Nm -.Op Fl c .Op Fl l | Fl s .Ar file1 file2 .Op Ar skip1 Op Ar skip2 @@ -56,15 +55,6 @@ Bytes and lines are numbered beginning with one. .Pp The following options are available: .Bl -tag -width flag -.It Fl c -Do the compare using -.Xr getc 3 -rather than -.Xr mmap 2 . -Combined with the -.Fl l -flag, this can be helpful in locating an I/O error in the underlying -device. .It Fl l Print the byte number (decimal) and the differing byte values (octal) for each difference. diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 4301731..eed0b52 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -29,20 +29,6 @@ * SUCH DAMAGE. */ -#include -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1987, 1990, 1993, 1994\ - The Regents of the University of California. All rights reserved."); -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94"; -#else -__RCSID("$NetBSD: cmp.c,v 1.20 2016/10/30 19:33:49 christos Exp $"); -#endif -#endif /* not lint */ - #include #include @@ -51,6 +37,7 @@ __RCSID("$NetBSD: cmp.c,v 1.20 2016/10/30 19:33:49 christos Exp $"); #include #include #include +#include #include #include #include @@ -59,7 +46,7 @@ __RCSID("$NetBSD: cmp.c,v 1.20 2016/10/30 19:33:49 christos Exp $"); int lflag, sflag; -__dead static void usage(void); +static void usage(void); int main(int argc, char *argv[]) @@ -72,11 +59,8 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); special = 0; - while ((ch = getopt(argc, argv, "cls")) != -1) + while ((ch = getopt(argc, argv, "ls")) != -1) switch (ch) { - case 'c': - special = 1; /* careful! Don't use mmap() */ - break; case 'l': /* print all differences */ lflag = 1; break; @@ -108,9 +92,6 @@ main(int argc, char *argv[]) exit(ERR_EXIT); } if (strcmp(file2 = argv[1], "-") == 0) { - if (special) - errx(ERR_EXIT, - "standard input may only be specified once"); special = 1; fd2 = 0; file2 = "stdin"; @@ -125,12 +106,12 @@ main(int argc, char *argv[]) char *ep; errno = 0; - skip1 = strtoq(argv[2], &ep, 0); + skip1 = strtoll(argv[2], &ep, 0); if (errno || ep == argv[2]) usage(); if (argc == 4) { - skip2 = strtoq(argv[3], &ep, 0); + skip2 = strtoll(argv[3], &ep, 0); if (errno || ep == argv[3]) usage(); } diff --git a/usr.bin/cmp/extern.h b/usr.bin/cmp/extern.h index d8a72ed..09800bc 100644 --- a/usr.bin/cmp/extern.h +++ b/usr.bin/cmp/extern.h @@ -37,8 +37,8 @@ void c_regular(int, const char *, off_t, off_t, int, const char *, off_t, off_t); void c_special(int, const char *, off_t, int, const char *, off_t); -__dead void diffmsg(const char *, const char *, off_t, off_t); -__dead void eofmsg(const char *, off_t, off_t); -__dead void errmsg(const char *, off_t, off_t); +void diffmsg(const char *, const char *, off_t, off_t); +void eofmsg(const char *, off_t, off_t); +void errmsg(const char *, off_t, off_t); extern int lflag, sflag; diff --git a/usr.bin/cmp/misc.c b/usr.bin/cmp/misc.c index 3195de9..7bc169f 100644 --- a/usr.bin/cmp/misc.c +++ b/usr.bin/cmp/misc.c @@ -29,15 +29,6 @@ * SUCH DAMAGE. */ -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94"; -#else -__RCSID("$NetBSD: misc.c,v 1.12 2009/04/11 12:16:12 lukem Exp $"); -#endif -#endif /* not lint */ - #include #include diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c index 63c663f..1112def 100644 --- a/usr.bin/cmp/regular.c +++ b/usr.bin/cmp/regular.c @@ -29,15 +29,6 @@ * SUCH DAMAGE. */ -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94"; -#else -__RCSID("$NetBSD: regular.c,v 1.24 2013/11/20 17:19:14 kleink Exp $"); -#endif -#endif /* not lint */ - #include #include #include @@ -54,7 +45,7 @@ void c_regular(int fd1, const char *file1, off_t skip1, off_t len1, int fd2, const char *file2, off_t skip2, off_t len2) { - u_char ch, *p1, *p2; + unsigned char ch, *p1, *p2; off_t byte, length, line; int dfound; size_t blk_sz, blk_cnt; diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c index 0b1afc5..e9a10a7 100644 --- a/usr.bin/cmp/special.c +++ b/usr.bin/cmp/special.c @@ -29,15 +29,6 @@ * SUCH DAMAGE. */ -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94"; -#else -__RCSID("$NetBSD: special.c,v 1.14 2011/11/28 10:10:10 wiz Exp $"); -#endif -#endif /* not lint */ - #include #include -- cgit v1.2.3-60-g2f50