]> git.wh0rd.org - dump.git/commitdiff
Some corrections from Uwe Gohlke.
authorStelian Pop <stelian@popies.net>
Sat, 22 Nov 2003 16:52:16 +0000 (16:52 +0000)
committerStelian Pop <stelian@popies.net>
Sat, 22 Nov 2003 16:52:16 +0000 (16:52 +0000)
compat/include/bsdcompat.h
dump/main.c
dump/tape.c
restore/restore.c
restore/tape.c
restore/utilities.c
rmt/rmt.c

index 0edf00db24009f3374303f7401b1d676e78beb7f..ce7d6538544999f99e5b8a8285908f107adc3851 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - AlcĂ´ve <www.alcove.com>, 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 <config.h>
@@ -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;
index 1bb5ca3abc3c2512ba76b1cf169173aed7842fd9..32db26dc02516bccc10f12d9a288d1c2ccb4e7a8 100644 (file)
@@ -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 <config.h>
@@ -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, 
index a8affbb70817b8954e000d97bfdecf3368b7ad61..f55334b1206af6c8f2468449bbc23c7be6a8099b 100644 (file)
@@ -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 <config.h>
@@ -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);
 }
 
 
index 9d18c6b621a6d491b0ff34428baacea535472636..b95e3569cd8b79e07c21ecc8c2f13c73fb5c8458 100644 (file)
@@ -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 <config.h>
@@ -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:
index b4fa15d93c8cdc9882f6a112524253614c6ee1d2..eca001d8aedcd1cf1556e38de43f0822728fd0dd 100644 (file)
@@ -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 <config.h>
@@ -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;
index d0539383a306ab194ae13c51998100acc2c2d5b3..e0db9afa83b5c68e9ed70d73e81450901f4a2123 100644 (file)
@@ -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 <config.h>
@@ -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 */
index 1543a7bca05b51da5efed5cff6c735c0d5c2e88f..05874a3f6a52f2d2e01d833c3747deb8d0efc6e8 100644 (file)
--- 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)) {