diff options
author | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-06-03 07:25:47 -0500 |
---|---|---|
committer | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-06-03 07:25:47 -0500 |
commit | 7672573e52e652a5b800638bd8605c1eee7c54b6 (patch) | |
tree | 869733f20f2edc0d0f4e6c2636ed44a0f057714d | |
parent | 910491b6123a35ec4ab1530dcb91659bcc3d1cad (diff) | |
download | userland-7672573e52e652a5b800638bd8605c1eee7c54b6.tar.gz userland-7672573e52e652a5b800638bd8605c1eee7c54b6.tar.bz2 userland-7672573e52e652a5b800638bd8605c1eee7c54b6.tar.xz userland-7672573e52e652a5b800638bd8605c1eee7c54b6.zip |
usr.bin/patch: make buildable
-rw-r--r-- | usr.bin/patch/backupfile.c | 5 | ||||
-rw-r--r-- | usr.bin/patch/inp.c | 13 | ||||
-rw-r--r-- | usr.bin/patch/mkpath.c | 3 | ||||
-rw-r--r-- | usr.bin/patch/patch.c | 5 | ||||
-rw-r--r-- | usr.bin/patch/pch.c | 5 | ||||
-rw-r--r-- | usr.bin/patch/util.c | 3 | ||||
-rw-r--r-- | usr.bin/patch/util.h | 12 |
7 files changed, 14 insertions, 32 deletions
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c index 25d6076..e685687 100644 --- a/usr.bin/patch/backupfile.c +++ b/usr.bin/patch/backupfile.c @@ -21,9 +21,6 @@ * David MacKenzie <djm@ai.mit.edu>. Some algorithms adapted from GNU Emacs. */ -#include <sys/cdefs.h> -__RCSID("$NetBSD: backupfile.c,v 1.15 2014/04/11 17:30:03 christos Exp $"); - #include <ctype.h> #include <dirent.h> #include <libgen.h> @@ -114,7 +111,7 @@ max_backup_version(const char *file, const char *dir) file_name_length = strlen(file); while ((dp = readdir(dirp)) != NULL) { - if (dp->d_namlen <= file_name_length) + if (strlen(dp->d_name) <= file_name_length) continue; this_version = version_number(file, dp->d_name, file_name_length); diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c index b434a88..b1c0312 100644 --- a/usr.bin/patch/inp.c +++ b/usr.bin/patch/inp.c @@ -30,9 +30,6 @@ * behaviour */ -#include <sys/cdefs.h> -__RCSID("$NetBSD: inp.c,v 1.26 2018/06/18 18:33:31 christos Exp $"); - #include <sys/types.h> #include <sys/file.h> #include <sys/stat.h> @@ -230,8 +227,8 @@ plan_a(const char *filename) strerror(errno)); } (void)dup2(devnull, STDOUT_FILENO); - argp[0] = __UNCONST(RCSDIFF); - argp[1] = __UNCONST(filename); + argp[0] = RCSDIFF; + argp[1] = filename; execv(RCSDIFF, argp); exit(127); } @@ -251,9 +248,9 @@ plan_a(const char *filename) case -1: fatal("can't fork: %s\n", strerror(errno)); case 0: - argp[0] = __UNCONST(CHECKOUT); - argp[1] = __UNCONST("-l"); - argp[2] = __UNCONST(filename); + argp[0] = CHECKOUT; + argp[1] = "-l"; + argp[2] = filename; execv(CHECKOUT, argp); exit(127); } diff --git a/usr.bin/patch/mkpath.c b/usr.bin/patch/mkpath.c index 3d18036..65d5389 100644 --- a/usr.bin/patch/mkpath.c +++ b/usr.bin/patch/mkpath.c @@ -33,9 +33,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> -__RCSID("$NetBSD: mkpath.c,v 1.1 2008/09/19 18:33:34 joerg Exp $"); - #include <sys/types.h> #include <sys/stat.h> #include <err.h> diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index 9f49e7f..c7c8f08 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -30,9 +30,6 @@ * behaviour */ -#include <sys/cdefs.h> -__RCSID("$NetBSD: patch.c,v 1.29 2011/09/06 18:25:14 joerg Exp $"); - #include <sys/types.h> #include <sys/stat.h> @@ -106,7 +103,7 @@ static bool spew_output(void); static void dump_line(LINENUM, bool); static bool patch_match(LINENUM, LINENUM, LINENUM); static bool similar(const char *, const char *, int); -__dead static void usage(void); +static void usage(void); /* true if -E was specified on command line. */ static bool remove_empty_files = false; diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index 8a635ad..38375c5 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -30,9 +30,6 @@ * behaviour */ -#include <sys/cdefs.h> -__RCSID("$NetBSD: pch.c,v 1.30 2018/06/18 18:33:31 christos Exp $"); - #include <sys/types.h> #include <sys/stat.h> @@ -448,7 +445,7 @@ skip_to(LINENUM file_pos, LINENUM file_line) } /* Make this a function for better debugging. */ -__dead static void +static void malformed(void) { fatal("malformed patch at line %ld: %s", p_input_line, buf); diff --git a/usr.bin/patch/util.c b/usr.bin/patch/util.c index 30e4f3c..fd1a583 100644 --- a/usr.bin/patch/util.c +++ b/usr.bin/patch/util.c @@ -30,9 +30,6 @@ * behaviour */ -#include <sys/cdefs.h> -__RCSID("$NetBSD: util.c,v 1.28 2018/06/18 18:33:31 christos Exp $"); - #include <sys/param.h> #include <sys/stat.h> diff --git a/usr.bin/patch/util.h b/usr.bin/patch/util.h index d8bde6c..43b752e 100644 --- a/usr.bin/patch/util.h +++ b/usr.bin/patch/util.h @@ -35,16 +35,16 @@ char *checked_in(char *); int backup_file(const char *); int move_file(const char *, const char *); int copy_file(const char *, const char *); -void say(const char *, ...) __printflike(1, 2); -void fatal(const char *, ...) __printflike(1, 2) __dead; -void pfatal(const char *, ...) __printflike(1, 2) __dead; -void ask(const char *, ...) __printflike(1, 2); +void say(const char *, ...); +void fatal(const char *, ...); +void pfatal(const char *, ...); +void ask(const char *, ...); char *savestr(const char *); void set_signals(int); void ignore_signals(void); void makedirs(const char *, bool); -void version(void) __dead; -void my_exit(int) __dead; +void version(void); +void my_exit(int); void *pch_realloc(void *, size_t, size_t); /* in mkpath.c */ |