Browse Source

macosx compat patches

Waldemar Brodkorb 15 years ago
parent
commit
be6324a13e
2 changed files with 7 additions and 25 deletions
  1. 2 2
      tools/adk/depmaker.c
  2. 5 23
      tools/cpio/src/cpio.c

+ 2 - 2
tools/adk/depmaker.c

@@ -133,14 +133,14 @@ int main() {
 	while ((pkgdirp = readdir(pkgdir)) != NULL) {
 	while ((pkgdirp = readdir(pkgdir)) != NULL) {
 		/* skip dotfiles */
 		/* skip dotfiles */
 		if (strncmp(pkgdirp->d_name, ".", 1) > 0) {
 		if (strncmp(pkgdirp->d_name, ".", 1) > 0) {
-			if (snprintf(path, MAXLINE, "package/%s/Makefile", pkgdirp->d_name) < 0)
+			if (snprintf(path, MAXPATH, "package/%s/Makefile", pkgdirp->d_name) < 0)
 				perror("Can not create string variable.");
 				perror("Can not create string variable.");
 			pkg = fopen(path, "r");
 			pkg = fopen(path, "r");
 			if (pkg == NULL)
 			if (pkg == NULL)
 				continue;
 				continue;
 			
 			
 			/* transform to uppercase variable name */
 			/* transform to uppercase variable name */
-			pkgvar = strndup(pkgdirp->d_name, strlen(pkgdirp->d_name));
+			pkgvar = strdup(pkgdirp->d_name);
 			for (i=0; i<(int)strlen(pkgvar); i++) {
 			for (i=0; i<(int)strlen(pkgvar); i++) {
 				if (pkgvar[i] == '+')
 				if (pkgvar[i] == '+')
 					pkgvar[i] = 'X';
 					pkgvar[i] = 'X';

+ 5 - 23
tools/cpio/src/cpio.c

@@ -82,12 +82,9 @@ int	sysv3;
 #if defined (__linux__) || defined (__sun) || defined (__FreeBSD__) || \
 #if defined (__linux__) || defined (__sun) || defined (__FreeBSD__) || \
 	defined (__hpux) || defined (_AIX) || defined (__NetBSD__) || \
 	defined (__hpux) || defined (_AIX) || defined (__NetBSD__) || \
 	defined (__OpenBSD__) || defined (__DragonFly__) || \
 	defined (__OpenBSD__) || defined (__DragonFly__) || \
-	defined (__APPLE__) || defined (__CYGWIN__)
+	defined (__CYGWIN__)
 #include <sys/mtio.h>
 #include <sys/mtio.h>
-#else	/* SVR4.2MP */
-#include <sys/scsi.h>
-#include <sys/st01.h>
-#endif	/* SVR4.2MP */
+#endif
 
 
 #include <iblok.h>
 #include <iblok.h>
 #include <sfile.h>
 #include <sfile.h>
@@ -4497,17 +4494,12 @@ tseek(off_t n)
 #if defined (__linux__) || defined (__sun) || defined (__FreeBSD__) || \
 #if defined (__linux__) || defined (__sun) || defined (__FreeBSD__) || \
 	defined (__hpux) || defined (_AIX) || defined (__NetBSD__) || \
 	defined (__hpux) || defined (_AIX) || defined (__NetBSD__) || \
 	defined (__OpenBSD__) || defined (__DragonFly__) || \
 	defined (__OpenBSD__) || defined (__DragonFly__) || \
-	defined (__APPLE__) || defined (__CYGWIN__)
+	defined (__CYGWIN__)
 		struct mtop	mo;
 		struct mtop	mo;
 		mo.mt_op = i > 0 ? MTFSR : MTBSR;
 		mo.mt_op = i > 0 ? MTFSR : MTBSR;
 		mo.mt_count = i > 0 ? i : -i;
 		mo.mt_count = i > 0 ? i : -i;
 		fault = ioctl(mt, MTIOCTOP, &mo);
 		fault = ioctl(mt, MTIOCTOP, &mo);
-#else	/* SVR4.2MP */
-		int	t, a;
-		t = i > 0 ? T_SBF : T_SBB;
-		a = i > 0 ? i : -i;
-		fault = ioctl(mt, t, a);
-#endif	/* SVR4.2MP */
+#endif
 	} else
 	} else
 		fault = lseek(mt, n - poffs, SEEK_CUR) == (off_t)-1 ? -1 : 0;
 		fault = lseek(mt, n - poffs, SEEK_CUR) == (off_t)-1 ? -1 : 0;
 	if (fault == 0)
 	if (fault == 0)
@@ -4783,7 +4775,7 @@ mstat(void)
 			tapeblock = md.bsize;
 			tapeblock = md.bsize;
 	}
 	}
 #elif defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
 #elif defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
-		|| defined (__DragonFly__) || defined (__APPLE__)
+		|| defined (__DragonFly__)
 	if ((mtst.st_mode&S_IFMT) == S_IFCHR) {
 	if ((mtst.st_mode&S_IFMT) == S_IFCHR) {
 		struct mtget	mg;
 		struct mtget	mg;
 		if (ioctl(mt, MTIOCGET, &mg) == 0)
 		if (ioctl(mt, MTIOCGET, &mg) == 0)
@@ -4797,16 +4789,6 @@ mstat(void)
 					MT_ST_BLKSIZE_SHIFT;
 					MT_ST_BLKSIZE_SHIFT;
 	}
 	}
 #elif defined (__hpux) || defined (_AIX)
 #elif defined (__hpux) || defined (_AIX)
-#else	/* SVR4.2MP */
-	if ((mtst.st_mode&S_IFMT) == S_IFCHR) {
-		struct blklen	bl;
-		if (ioctl(mt, T_RDBLKLEN, &bl) == 0)
-			/*
-			 * These are not the values we're interested in
-			 * (always 1 and 16M-1 for DAT/DDS tape drives).
-			 */
-			tapeblock = 0;
-	}
 #endif	/* SVR4.2MP */
 #endif	/* SVR4.2MP */
 	if (blksiz == 0)
 	if (blksiz == 0)
 		switch (mtst.st_mode&S_IFMT) {
 		switch (mtst.st_mode&S_IFMT) {