summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-08 05:07:11 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-08 05:07:11 -0500
commitca8d28ae0acfd2556c86da9b0e8d645f642b83be (patch)
tree7dd185477e694fa3837abaa0bcf1823dabdb2c68
parent58c9a4b908c79c0b6183951e7dd68dc69cbf4415 (diff)
downloaduserland-ca8d28ae0acfd2556c86da9b0e8d645f642b83be.tar.gz
userland-ca8d28ae0acfd2556c86da9b0e8d645f642b83be.tar.bz2
userland-ca8d28ae0acfd2556c86da9b0e8d645f642b83be.tar.xz
userland-ca8d28ae0acfd2556c86da9b0e8d645f642b83be.zip
usr.bin/split: make buildable against libbsd
-rw-r--r--usr.bin/split/split.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index e538da1..bb45e02 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -29,19 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1987, 1993, 1994\
- The Regents of the University of California. All rights reserved.");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)split.c 8.3 (Berkeley) 4/25/94";
-#endif
-__RCSID("$NetBSD: split.c,v 1.27 2017/01/10 21:14:13 christos Exp $");
-#endif /* not lint */
-
#include <sys/param.h>
#include <sys/stat.h>
@@ -51,10 +38,13 @@ __RCSID("$NetBSD: split.c,v 1.27 2017/01/10 21:14:13 christos Exp $");
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <bsd/stdlib.h>
#include <string.h>
#include <unistd.h>
#define DEFLINE 1000 /* Default num lines per file. */
+#define MAXBSIZE (64*1024)
+#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
static int file_open; /* If a file open. */
static int ifd = STDIN_FILENO, ofd = -1; /* Input/output file descriptors. */
@@ -62,10 +52,10 @@ static char *fname; /* File name prefix. */
static size_t sfxlen = 2; /* suffix length. */
static void newfile(void);
-static void split1(off_t, int) __dead;
-static void split2(off_t) __dead;
-static void split3(off_t) __dead;
-static void usage(void) __dead;
+static void split1(off_t, int);
+static void split2(off_t);
+static void split3(off_t);
+static void usage(void);
static size_t bigwrite(int, void const *, size_t);
int