summaryrefslogtreecommitdiff
path: root/archivers/afio/patches
diff options
context:
space:
mode:
Diffstat (limited to 'archivers/afio/patches')
-rw-r--r--archivers/afio/patches/patch-ab15
-rw-r--r--archivers/afio/patches/patch-ac229
2 files changed, 230 insertions, 14 deletions
diff --git a/archivers/afio/patches/patch-ab b/archivers/afio/patches/patch-ab
index 957e49b7624..e4cd58bdbc8 100644
--- a/archivers/afio/patches/patch-ab
+++ b/archivers/afio/patches/patch-ab
@@ -1,4 +1,8 @@
-$NetBSD: patch-ab,v 1.2 2005/10/03 11:15:55 joerg Exp $
+$NetBSD: patch-ab,v 1.3 2012/06/23 18:02:15 dholland Exp $
+
+- Use NAME_MAX if available rather than relying on MAXNAMLEN.
+- Fix Solaris preprocessor symbols.
+- Fix bad calls to execlp() that break on 64-bit platforms.
--- compfile.c.orig 2003-06-24 21:32:20.000000000 +0000
+++ compfile.c
@@ -10,6 +14,15 @@ $NetBSD: patch-ab,v 1.2 2005/10/03 11:15:55 joerg Exp $
#include <unistd.h>
#include <string.h>
+@@ -179,7 +180,7 @@ int setupgzip(char *name)
+ if (open (name, O_RDONLY) >= 0)
+ {
+ if(! compressargs)
+- execlp (compressprog, compressprog, "-c", farg, 0);
++ execlp (compressprog, compressprog, "-c", farg, (char *)NULL);
+ else
+ execvp (compressprog, compress_arg_list);
+ }
@@ -210,7 +211,7 @@ void waitforgzip()
* version;
*/
diff --git a/archivers/afio/patches/patch-ac b/archivers/afio/patches/patch-ac
index 97563cdbc6d..51196a4ba15 100644
--- a/archivers/afio/patches/patch-ac
+++ b/archivers/afio/patches/patch-ac
@@ -1,10 +1,68 @@
-$NetBSD: patch-ac,v 1.1 2005/01/19 17:08:09 tv Exp $
+$NetBSD: patch-ac,v 1.2 2012/06/23 18:02:15 dholland Exp $
---- afio.c.orig 2005-01-19 11:49:18.000000000 -0500
+- Use standard headers.
+- Use strerror, not sys_errlist and sys_nerr.
+- Use POSIX utime() interface, not half-baked version.
+- Use W* macros from sys/wait.h instead of hard-coding the historic
+ bit patterns.
+- Build fix for makedev() on Solaris and Interix.
+- Fix bad calls to execlp() that break on 64-bit platforms.
+
+--- afio.c.orig 2003-12-20 22:16:13.000000000 +0000
+++ afio.c
-@@ -210,8 +210,11 @@ extern char *sys_errlist[];
+@@ -166,52 +166,40 @@ static char *ident = "$Header: /u/buhrt/
+ #include <signal.h>
+ #include <strings.h>
+ #include <sys/wait.h>
+-#define linux_tstamp 1
+-/* fix SunOS errno.h not declaring what the manpage says it declares
+- bogosity. */
+- extern int sys_nerr;
+- extern char *sys_errlist[];
+-#endif
+-
+-#ifdef hpux
+- /* Fix that HPUX dosent have sys_nerr or sys_errlist
+- Added by Daniel Andersson, daniel.andersson@sto.sema.se
+- */
+-extern int sys_nerr;
+-extern char *sys_errlist[];
+ #endif
+
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <sys/signal.h>
++#include <signal.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/wait.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <utime.h>
+ #include "patchlevel.h"
+
+ #ifdef linux
+-
+-#define linux_tstamp 1
+-
+-#include <utime.h>
+-#include <sys/wait.h>
+-
+ /* for flushing floppy cache */
+ #include <linux/fd.h>
+ #endif
+
+ /* compatibility fixes for IRIX native c compiler. */
+ #ifdef irix_cc_compatibility
+-#define linux_tstamp 1
+ #include <strings.h>
#endif
++/* nothing should need this */
++/*#define broken_utime*/
++
#ifndef major
-#ifdef sun
+#if defined(sun) || defined(__INTERIX)
@@ -15,20 +73,165 @@ $NetBSD: patch-ac,v 1.1 2005/01/19 17:08:09 tv Exp $
#else
#include <sys/sysmacros.h>
#endif
-@@ -4354,12 +4357,16 @@ fswrite (fd, buf, len)
+@@ -1122,7 +1110,7 @@ savedirstamp (char *name, time_t mtime)
+ STATIC void
+ restoredirstamps (void)
+ {
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ auto struct utimbuf tstamp;
+ #else
+ auto time_t tstamp[2];
+@@ -1130,7 +1118,7 @@ restoredirstamps (void)
+ Dir *DirP_forw;
+ while(DirP!=NULL)
+ {
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ tstamp.actime = DirP->d_mtime;
+ tstamp.modtime = DirP->d_mtime;
+ /* no error code checking on purpose */
+@@ -1212,7 +1200,7 @@ readcheck (av)
+ auto char name[PATHSIZE];
+ auto char local[PATHSIZE];
+ int sel, res;
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ auto struct utimbuf tstamp;
+ #else
+ auto time_t tstamp[2];
+@@ -1241,7 +1229,7 @@ readcheck (av)
+ if(aflag && atime_sb_valid && ((sb.sb_mode & S_IFMT)==S_IFREG))
+ {
+ /* reset access time, this distroys the ctime btw. */
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ tstamp.actime = atime_sb.sb_atime;
+ tstamp.modtime = atime_sb.sb_mtime;
+ VOID utime (name, &tstamp);
+@@ -1585,7 +1573,7 @@ incheckdata (int fd, off_t size, char *n
+ if(compressargs)
+ execvp (compressprog, compress_arg_list);
+ else
+- execlp (compressprog, compressprog, "-d", "-c", 0);
++ execlp (compressprog, compressprog, "-d", "-c", (char *)NULL);
+ fprintf (stderr, "Could not uncompress, errno %d\n", errno);
+ exit(1);
+ break;
+@@ -1696,7 +1684,7 @@ inentry (name, asb)
+ reg Link *linkp;
+ reg int ifd;
+ reg int ofd;
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ auto struct utimbuf tstamp;
+ #else
+ auto time_t tstamp[2];
+@@ -1729,7 +1717,7 @@ inentry (name, asb)
+ /* Cannot set utime on symlink (at least not under Linux) */
+ if((asb->sb_mode & S_IFMT) != S_IFLNK)
+ {
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ tstamp.actime = tstamp.modtime = mflag ? timenow : asb->sb_mtime;
+ VOID utime (name, &tstamp);
+ #else
+@@ -3004,7 +2992,7 @@ opencontrolscript (char *name)
+ VOID dup (pfd[0]);
+ VOID close (pfd[0]);
+
+- execlp (controlscript, controlscript, label, 0);
++ execlp (controlscript, controlscript, label, (char *)NULL);
+
+ warnarch("Problems running control script:",(off_t)0);
+ warn(controlscript,syserr());
+@@ -3266,7 +3254,7 @@ openotty (name, asb, linkp, ispass, dozf
+ if(compressargs)
+ execvp (compressprog, compress_arg_list);
+ else
+- execlp (compressprog, compressprog, "-d", "-c", 0);
++ execlp (compressprog, compressprog, "-d", "-c", (char *)NULL);
+ fprintf (stderr, "Could not uncompress, errno %d\n", errno);
+ exit (1);
+ }
+@@ -3493,7 +3481,7 @@ out (av)
+ auto char name[PATHSIZE];
+ auto char fsname[PATHSIZE];
+ auto int compression;
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ auto struct utimbuf tstamp;
+ #else
+ auto time_t tstamp[2];
+@@ -3638,7 +3626,7 @@ out (av)
+ if(aflag && *fsname && ((sb.sb_mode & S_IFMT)==S_IFREG))
+ {
+ /* reset access time, this distroys the ctime btw. */
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ tstamp.actime = sb.sb_atime;
+ tstamp.modtime = sb.sb_mtime;
+ VOID utime (fsname, &tstamp);
+@@ -4133,7 +4121,7 @@ passitem (from, asb, ifd, dir)
+ {
+ reg int ofd;
+
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ auto struct utimbuf tstamp;
+ #else
+ auto time_t tstamp[2];
+@@ -4149,7 +4137,7 @@ passitem (from, asb, ifd, dir)
+ continue;
+ if (ofd > 0)
+ passdata (from, ifd, to, ofd);
+-#ifdef linux_tstamp
++#ifndef broken_utime
+ tstamp.actime = tstamp.modtime = mflag ? timenow : asb->sb_mtime;
+ VOID utime (to, &tstamp);
+ #else
+@@ -4354,12 +4342,7 @@ fswrite (fd, buf, len)
STATIC char *
syserr ()
{
-+#ifdef __INTERIX
+- static char msg[40];
+-
+- if (errno > 0 && errno < sys_nerr)
+- return ((char *) sys_errlist[errno]);
+- VOID sprintf (msg, "Unknown error (errno %d)", errno);
+- return (msg);
+ return strerror(errno);
-+#else
- static char msg[40];
-
- if (errno > 0 && errno < sys_nerr)
- return ((char *) sys_errlist[errno]);
- VOID sprintf (msg, "Unknown error (errno %d)", errno);
- return (msg);
-+#endif
}
/*
+@@ -4765,7 +4748,7 @@ xwait (pid, what, compstat2)
+ char *what;
+ int compstat2;
+ {
+- reg int status;
++ int status;
+ reg Child *cp;
+ reg Child **acp;
+ auto char why[100];
+@@ -4782,16 +4765,16 @@ xwait (pid, what, compstat2)
+ free ((char *) cp);
+ if (status == 0)
+ return (0);
+- if (status & 0377)
++ if (WIFSIGNALED(status))
+ VOID sprintf (why, "Killed by signal %d%s",
+- status & 0177, status & 0200 ? " -- core dumped" : "");
++ WTERMSIG(status), WCOREDUMP(status) ? " -- core dumped" : "");
+ else
+- VOID sprintf (why, "Exit %d", (status >> 8) & 0377);
++ VOID sprintf (why, "Exit %d", WEXITSTATUS(status));
+
+- if ((!compstat2 && (((status >> 8) & 0377) != 2)) || compstat2)
++ if ((!compstat2 && (WEXITSTATUS(status) != 2)) || compstat2)
+ return (warn (what, why));
+ else
+- return ((status >> 8) & 0377);
++ return WEXITSTATUS(status);
+ }
+
+