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)
This commit is contained in:
Brooks Davis 2024-09-30 16:56:09 +01:00
parent f2d04fb7c6
commit cc977a4b8b
3 changed files with 19 additions and 17 deletions

View file

@ -1,6 +1,6 @@
PORTNAME= copytape PORTNAME= copytape
PORTVERSION= 1.0 PORTVERSION= 1.0
PORTREVISION= 1 PORTREVISION= 2
CATEGORIES= sysutils CATEGORIES= sysutils
MASTER_SITES= COMP_SOURCES/unix/volume10 MASTER_SITES= COMP_SOURCES/unix/volume10
DISTNAME= copytape DISTNAME= copytape

View file

@ -1,15 +1,28 @@
--- copytape.c.orig Fri Oct 23 17:23:06 1998 --- copytape.c.orig
+++ copytape.c Fri Oct 23 17:23:46 1998 +++ copytape.c
@@ -36,7 +36,7 @@ @@ -28,15 +28,18 @@
*/
extern int errno;
-#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 262144 /* max tape block size */
+#define BUFLEN (1024*1024) /* max tape block size */ +#define BUFLEN (1024*1024) /* max tape block size */
#define TAPE_MARK -100 /* return record length if we read a #define TAPE_MARK -100 /* return record length if we read a
* tape mark */ * tape mark */
#define END_OF_TAPE -101 /* 2 consecutive tape marks */ #define END_OF_TAPE -101 /* 2 consecutive tape marks */
@@ -149,7 +149,7 @@ @@ -149,7 +152,7 @@
len = input(from); len = input(from);
} while (len > 0); } while (len > 0);
if (len == FORMAT_ERROR) { if (len == FORMAT_ERROR) {

View file

@ -1,11 +0,0 @@
--- copytape.c.orig 2013-10-16 06:54:00.000000000 -0400
+++ copytape.c 2013-10-16 06:54:13.000000000 -0400
@@ -29,6 +29,8 @@
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mtio.h>