summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-09-28 16:39:38 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-09-28 16:39:38 +0200
commitbe6324a13ebb5419d66c285a4c59b16579d2a147 (patch)
tree3cfe54042d8cfb1b8c311c353377ef64042efb16
parentb8ff136fd23eb21ff3cbf0dce4b81b44823a4ce5 (diff)
macosx compat patches
-rw-r--r--tools/adk/depmaker.c4
-rw-r--r--tools/cpio/src/cpio.c28
2 files changed, 7 insertions, 25 deletions
diff --git a/tools/adk/depmaker.c b/tools/adk/depmaker.c
index 9336aaa9f..2b6cada0b 100644
--- a/tools/adk/depmaker.c
+++ b/tools/adk/depmaker.c
@@ -133,14 +133,14 @@ int main() {
while ((pkgdirp = readdir(pkgdir)) != NULL) {
/* skip dotfiles */
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.");
pkg = fopen(path, "r");
if (pkg == NULL)
continue;
/* 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++) {
if (pkgvar[i] == '+')
pkgvar[i] = 'X';
diff --git a/tools/cpio/src/cpio.c b/tools/cpio/src/cpio.c
index cf9cb0ef8..8e81a9819 100644
--- a/tools/cpio/src/cpio.c
+++ b/tools/cpio/src/cpio.c
@@ -82,12 +82,9 @@ int sysv3;
#if defined (__linux__) || defined (__sun) || defined (__FreeBSD__) || \
defined (__hpux) || defined (_AIX) || defined (__NetBSD__) || \
defined (__OpenBSD__) || defined (__DragonFly__) || \
- defined (__APPLE__) || defined (__CYGWIN__)
+ defined (__CYGWIN__)
#include <sys/mtio.h>
-#else /* SVR4.2MP */
-#include <sys/scsi.h>
-#include <sys/st01.h>
-#endif /* SVR4.2MP */
+#endif
#include <iblok.h>
#include <sfile.h>
@@ -4497,17 +4494,12 @@ tseek(off_t n)
#if defined (__linux__) || defined (__sun) || defined (__FreeBSD__) || \
defined (__hpux) || defined (_AIX) || defined (__NetBSD__) || \
defined (__OpenBSD__) || defined (__DragonFly__) || \
- defined (__APPLE__) || defined (__CYGWIN__)
+ defined (__CYGWIN__)
struct mtop mo;
mo.mt_op = i > 0 ? MTFSR : MTBSR;
mo.mt_count = i > 0 ? i : -i;
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
fault = lseek(mt, n - poffs, SEEK_CUR) == (off_t)-1 ? -1 : 0;
if (fault == 0)
@@ -4783,7 +4775,7 @@ mstat(void)
tapeblock = md.bsize;
}
#elif defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
- || defined (__DragonFly__) || defined (__APPLE__)
+ || defined (__DragonFly__)
if ((mtst.st_mode&S_IFMT) == S_IFCHR) {
struct mtget mg;
if (ioctl(mt, MTIOCGET, &mg) == 0)
@@ -4797,16 +4789,6 @@ mstat(void)
MT_ST_BLKSIZE_SHIFT;
}
#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 */
if (blksiz == 0)
switch (mtst.st_mode&S_IFMT) {