From 3e8961b70386c298ef95b85171ec9bb5dea9649a Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Sat, 22 Nov 2003 16:52:16 +0000 Subject: [PATCH] Some corrections from Uwe Gohlke. --- compat/include/bsdcompat.h | 4 ++-- dump/main.c | 10 +++++----- dump/tape.c | 4 ++-- restore/restore.c | 6 +++++- restore/tape.c | 6 ++---- restore/utilities.c | 35 ++++++++++++++++------------------- rmt/rmt.c | 22 ++++++++++++++++++++-- 7 files changed, 52 insertions(+), 35 deletions(-) diff --git a/compat/include/bsdcompat.h b/compat/include/bsdcompat.h index 0edf00d..ce7d653 100644 --- a/compat/include/bsdcompat.h +++ b/compat/include/bsdcompat.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - AlcĂ´ve , 2000-2002 * - * $Id: bsdcompat.h,v 1.20 2003/10/26 16:05:46 stelian Exp $ + * $Id: bsdcompat.h,v 1.21 2003/11/22 16:52:16 stelian Exp $ */ #include @@ -87,7 +87,7 @@ typedef int8_t __s8; typedef int16_t __s16; typedef int32_t __s32; #ifndef u_int -#typedef unsigned int u_int; +typedef unsigned int u_int; #endif #ifndef u_int16_t typedef unsigned short u_int16_t; diff --git a/dump/main.c b/dump/main.c index 1bb5ca3..32db26d 100644 --- a/dump/main.c +++ b/dump/main.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.87 2003/10/26 16:05:47 stelian Exp $"; + "$Id: main.c,v 1.88 2003/11/22 16:52:16 stelian Exp $"; #endif /* not lint */ #include @@ -192,8 +192,8 @@ static void do_exclude_from_file __P((char *)); static void do_exclude_ino_str __P((char *)); static void incompat_flags __P((int, char, char)); -static char* iexclude_bitmap = NULL; /* the inode exclude bitmap */ -static int iexclude_bitmap_bytes = 0; /* size of bitmap in bytes */ +static char* iexclude_bitmap = NULL; /* the inode exclude bitmap */ +static unsigned int iexclude_bitmap_bytes = 0; /* size of bitmap in bytes */ int main(int argc, char *argv[]) @@ -1282,12 +1282,12 @@ do_exclude_ino(dump_ino_t ino, const char *reason) msg("allocating memory failed\n"); exit(X_STARTUP); } - int j; + unsigned int j; for (j = 0; j < iexclude_bitmap_bytes; j++) iexclude_bitmap[j] = 0; } else { - int oldsize = iexclude_bitmap_bytes; + unsigned int oldsize = iexclude_bitmap_bytes; iexclude_bitmap_bytes *= (ino / 8 + 1) / iexclude_bitmap_bytes + 1; iexclude_bitmap = (char*) realloc(iexclude_bitmap, diff --git a/dump/tape.c b/dump/tape.c index a8affbb..f55334b 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.78 2003/10/26 16:05:47 stelian Exp $"; + "$Id: tape.c,v 1.79 2003/11/22 16:52:16 stelian Exp $"; #endif /* not lint */ #include @@ -1404,7 +1404,7 @@ dump_atomic_write(int fd, const void *buf, size_t count) while ((got = write(fd, buf, need)) > 0 && (need -= got) > 0) (char *)buf += got; } while (got == -1 && errno == EINTR); - return (got < 0 ? got : count - need); + return (got < 0 ? got : (ssize_t)count - need); } diff --git a/restore/restore.c b/restore/restore.c index 9d18c6b..b95e356 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.32 2003/10/26 16:05:48 stelian Exp $"; + "$Id: restore.c,v 1.33 2003/11/22 16:52:16 stelian Exp $"; #endif /* not lint */ #include @@ -817,6 +817,7 @@ finderres: (void)extractfinderinfoufs(myname(ep)); #else msg("MacOSX not supported in this version, skipping\n"); + skipfile(); #endif break; case EXT_MACOSRESFORK: @@ -824,6 +825,7 @@ finderres: (void)extractresourceufs(myname(ep)); #else msg("MacOSX not supported in this version, skipping\n"); + skipfile(); #endif break; case EXT_ACL: @@ -1077,6 +1079,7 @@ finderres: (void)extractfinderinfoufs(myname(ep)); #else msg("MacOSX not supported in this version, skipping\n"); + skipfile(); #endif break; case EXT_MACOSRESFORK: @@ -1084,6 +1087,7 @@ finderres: (void)extractresourceufs(myname(ep)); #else msg("MacOSX not supported in this version, skipping\n"); + skipfile(); #endif break; case EXT_ACL: diff --git a/restore/tape.c b/restore/tape.c index b4fa15d..eca001d 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.75 2003/10/26 16:05:48 stelian Exp $"; + "$Id: tape.c,v 1.76 2003/11/22 16:52:16 stelian Exp $"; #endif /* not lint */ #include @@ -1000,12 +1000,10 @@ extractfinderinfoufs(char *name) int flags; mode_t mode; struct timeval timep[2]; - struct entry *ep; - int sz; - attrinfo_block_t gABuf; u_int32_t uid; u_int32_t gid; char path[MAXPATHLEN], fname[MAXPATHLEN]; + int toto; curfile.name = name; curfile.action = USING; diff --git a/restore/utilities.c b/restore/utilities.c index d053938..e0db9af 100644 --- a/restore/utilities.c +++ b/restore/utilities.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: utilities.c,v 1.23 2003/10/26 16:05:48 stelian Exp $"; + "$Id: utilities.c,v 1.24 2003/11/22 16:52:16 stelian Exp $"; #endif /* not lint */ #include @@ -506,7 +506,7 @@ void resizemaps(dump_ino_t oldmax, dump_ino_t newmax) void GetPathFile(char *source, char *path, char *fname) { - char *p, *s; + char *p, *s; *path = 0; *fname = 0; @@ -606,13 +606,13 @@ Inode2Tapepos(dump_ino_t ino, long *tnum, long long *tpos, int exactmatch) int GetSCSIIDFromPath(char *devPath, long *id) { - int len; - char fbuff[2048]; - char path[2048]; - char fname[2048]; - char *fpn = fname; - char idstr[32]; - char *ip = idstr; + int len; + char fbuff[2048]; + char path[2048]; + char fname[2048]; + char *fpn = fname; + char idstr[32]; + char *ip = idstr; bzero(fbuff, sizeof(fbuff)); if ((len = readlink(devPath, fbuff, 2048)) == -1) { @@ -643,17 +643,14 @@ int CreateAppleDoubleFileRes(char *oFile, FndrFileInfo *finderinfo, mode_t mode, int flags, struct timeval *timep, u_int32_t uid, u_int32_t gid) { - int err = 0; - int fdout; - char *p; - char *f; - char *pp; + int err = 0; + int fdout; + char *p; + char *pp; ASDHeaderPtr hp; - ASDEntryPtr ep; - long thesize; - long n; - long loops; - long remain; + ASDEntryPtr ep; + long thesize; + long n; n = 1; /* number of entries in double file ._ only finderinfo */ diff --git a/rmt/rmt.c b/rmt/rmt.c index 1543a7b..05874a3 100644 --- a/rmt/rmt.c +++ b/rmt/rmt.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: rmt.c,v 1.27 2003/10/26 16:05:49 stelian Exp $"; + "$Id: rmt.c,v 1.28 2003/11/22 16:52:16 stelian Exp $"; #endif /* not linux */ /* @@ -204,7 +204,25 @@ top: getstring(pos); DEBUG2("rmtd: L %s %s\n", count, pos); if (!magtape) { /* traditional */ - rval = LSEEK(tape, (OFF_T)atoll(count), atoi(pos)); + switch (atoi(pos)) { + case SEEK_SET: + case SEEK_CUR: + case SEEK_END: + rval = LSEEK(tape, (OFF_T)atoll(count), atoi(pos)); + break; +#ifdef USE_QFA + case LSEEK_GET_TAPEPOS: + rval = LSEEK(tape, (OFF_T)0, SEEK_CUR); + break; + case LSEEK_GO2_TAPEPOS: + rval = LSEEK(tape, (OFF_T)atoll(count), SEEK_SET); + break; +#endif /* USE_QFA */ + default: + errno = EINVAL; + goto ioerror; + break; + } } else { switch (atoi(pos)) { -- 2.39.2