git: cc977a4b8b8b - main - sysutils/copytape: include errno.h for errno

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 23:59:26 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cc977a4b8b8bd932d57b86c55415328eb09e3647

commit cc977a4b8b8bd932d57b86c55415328eb09e3647
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-09-30 15:56:09 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-09-30 23:59:21 +0000

    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)
---
 sysutils/copytape/Makefile                         |  2 +-
 .../files/{patch-copytape.c_1 => patch-copytape.c} | 23 +++++++++++++++++-----
 sysutils/copytape/files/patch-copytape.c_2         | 11 -----------
 3 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/sysutils/copytape/Makefile b/sysutils/copytape/Makefile
index ede11c03c22a..c2ad2ab39f43 100644
--- a/sysutils/copytape/Makefile
+++ b/sysutils/copytape/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=		copytape
 PORTVERSION=		1.0
-PORTREVISION=	1
+PORTREVISION=		2
 CATEGORIES=		sysutils
 MASTER_SITES=		COMP_SOURCES/unix/volume10
 DISTNAME=		copytape
diff --git a/sysutils/copytape/files/patch-copytape.c_1 b/sysutils/copytape/files/patch-copytape.c
similarity index 59%
rename from sysutils/copytape/files/patch-copytape.c_1
rename to sysutils/copytape/files/patch-copytape.c
index 0be1bdc8d526..8dc9a0708c88 100644
--- a/sysutils/copytape/files/patch-copytape.c_1
+++ b/sysutils/copytape/files/patch-copytape.c
@@ -1,15 +1,28 @@
---- copytape.c.orig	Fri Oct 23 17:23:06 1998
-+++ copytape.c	Fri Oct 23 17:23:46 1998
-@@ -36,7 +36,7 @@
+--- copytape.c.orig
++++ copytape.c
+@@ -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		(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 +149,7 @@
+@@ -149,7 +152,7 @@
  	    len = input(from);
  	} while (len > 0);
  	if (len == FORMAT_ERROR) {
diff --git a/sysutils/copytape/files/patch-copytape.c_2 b/sysutils/copytape/files/patch-copytape.c_2
deleted file mode 100644
index 8838843a4939..000000000000
--- a/sysutils/copytape/files/patch-copytape.c_2
+++ /dev/null
@@ -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>