summaryrefslogtreecommitdiff
path: root/sysutils/copytape/files/patch-copytape.c
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2024-09-30 16:56:09 +0100
committerBrooks Davis <brooks@FreeBSD.org>2024-10-01 00:59:21 +0100
commitcc977a4b8b8bd932d57b86c55415328eb09e3647 (patch)
tree984e4f1f2a239c04b5b9b2874e9ce1a6f5fa6ae3 /sysutils/copytape/files/patch-copytape.c
parentmultimedia/plexmediaserver-plexpass: Update to 1.41.1.9057 (diff)
sysutils/copytape: include errno.h for errno
errno must be accessed by a macro from errno.h. Tidy includes and add unistd.h for read/write. Consolidate patches for easy of maintenance. This code is borderline useless and certainly broken with modern tape sizes due to the use of ints for sizes. PR: 281781 Approved by: sjroz@verizon.net (maintainer)
Diffstat (limited to 'sysutils/copytape/files/patch-copytape.c')
-rw-r--r--sysutils/copytape/files/patch-copytape.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/sysutils/copytape/files/patch-copytape.c b/sysutils/copytape/files/patch-copytape.c
new file mode 100644
index 000000000000..8dc9a0708c88
--- /dev/null
+++ b/sysutils/copytape/files/patch-copytape.c
@@ -0,0 +1,33 @@
+--- copytape.c.orig
++++ copytape.c
+@@ -28,15 +28,18 @@
+ */
+
+
+-#include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/mtio.h>
+ #include <sys/file.h>
+
+-extern int errno;
++#include <errno.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
+
+-#define BUFLEN 262144 /* max tape block size */
++#define BUFLEN (1024*1024) /* max tape block size */
+ #define TAPE_MARK -100 /* return record length if we read a
+ * tape mark */
+ #define END_OF_TAPE -101 /* 2 consecutive tape marks */
+@@ -149,7 +152,7 @@
+ len = input(from);
+ } while (len > 0);
+ if (len == FORMAT_ERROR) {
+- perror(stderr, "copytape: format error on skip");
++ perror("copytape: format error on skip");
+ exit(-1);
+ };
+ if (len == END_OF_TAPE) {