]> git.wh0rd.org - dump.git/commitdiff
Fixed largefile seeks in rmt
authorStelian Pop <stelian@popies.net>
Wed, 12 Feb 2003 11:02:28 +0000 (11:02 +0000)
committerStelian Pop <stelian@popies.net>
Wed, 12 Feb 2003 11:02:28 +0000 (11:02 +0000)
CHANGES
common/dumprmt.c
restore/tape.c
rmt/rmt.c

diff --git a/CHANGES b/CHANGES
index e3b00042622eb0c7cde9546094181ad7cf844746..659a36f826b91d8bc9c5c024e9f2bc1ceb51d868 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.215 2003/02/11 12:43:44 stelian Exp $
+$Id: CHANGES,v 1.216 2003/02/12 11:02:28 stelian Exp $
 
 Changes between versions 0.4b33 and 0.4b34 (released ?????????????????)
 =======================================================================
@@ -20,6 +20,10 @@ Changes between versions 0.4b33 and 0.4b34 (released ?????????????????)
        even when using a remote tape. Thanks to Fabrice Bellet 
        <fabrice@bellet.info> for reporting the bug.
 
+5.     Fixed (again) handling of long (largefile) seeks in rmt.
+       Thanks to Fabrice Bellet <fabrice@bellet.info> for reporting
+       the bug.
+
 Changes between versions 0.4b32 and 0.4b33 (released February 10, 2003)
 =======================================================================
 
index 1d49a240d5e8883aeb9c650c997d59f0e1c12195..699122f4349d666fb21c3719a03958f0ed8fe58e 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dumprmt.c,v 1.24 2003/01/10 14:42:50 stelian Exp $";
+       "$Id: dumprmt.c,v 1.25 2003/02/12 11:02:29 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -104,12 +104,12 @@ int rshpid = -1;
 static const char *rmtpeer = 0;
 
 static int okname __P((const char *));
-static int rmtcall __P((const char *, const char *));
+static OFF_T rmtcall __P((const char *, const char *));
 static void rmtconnaborted __P((int));
 static int rmtgetb __P((void));
 static int rmtgetconn __P((void));
 static void rmtgets __P((char *, size_t));
-static int rmtreply __P((const char *));
+static OFF_T rmtreply __P((const char *));
 static  int piped_child __P((const char **command));
 #ifdef KERBEROS
 int    krcmd __P((char **, int /*u_short*/, char *, char *, int *, char *));
@@ -367,7 +367,7 @@ rmtioctl(int cmd, int count)
        return (rmtcall("ioctl", buf));
 }
 
-static int
+static OFF_T
 rmtcall(const char *cmd, const char *buf)
 {
 
@@ -376,7 +376,7 @@ rmtcall(const char *cmd, const char *buf)
        return (rmtreply(cmd));
 }
 
-static int
+static OFF_T
 rmtreply(const char *cmd)
 {
        char *cp;
@@ -401,7 +401,7 @@ rmtreply(const char *cmd)
                    code);
                rmtconnaborted(0);
        }
-       return (atoi(code + 1));
+       return (OFF_T)(atoll(code + 1));
 }
 
 static int
index 9bfb4c5051e74098d6cfa38670cf84d8fcf36ce9..3db8f07fe5618d63bf7d6f354157b342697c5f0d 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.69 2003/02/11 12:43:45 stelian Exp $";
+       "$Id: tape.c,v 1.70 2003/02/12 11:02:30 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -2085,7 +2085,8 @@ setmagtapein(void) {
                        magtapein = ioctl(mt, MTIOCGET, (char *)&mt_stat) == 0;
        }
 
-       Vprintf(stdout,"Input is from %s\n", 
+       Vprintf(stdout,"Input is from a %s %s\n",
+                       host ? "remote" : "local",
                        magtapein ? "tape" :
                        Vflag ? "multi-volume (no tape)" : "file/pipe");
 }
index 3167e1dd76e1f4015ccf83af6d26a763a28b7e0f..7f93f57cf32991dd70d96fa329d05ab867db7cb5 100644 (file)
--- a/rmt/rmt.c
+++ b/rmt/rmt.c
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: rmt.c,v 1.22 2003/01/10 14:42:51 stelian Exp $";
+       "$Id: rmt.c,v 1.23 2003/02/12 11:02:31 stelian Exp $";
 #endif /* not linux */
 
 /*
@@ -122,7 +122,7 @@ void         getstring __P((char *));
 int
 main(int argc, char *argv[])
 {
-       int rval = 0;
+       OFF_T rval = 0;
        char c;
        int n, i, cc, oflags;
        unsigned long block = 0;
@@ -214,7 +214,7 @@ top:
                rval = read(tape, record, n);
                if (rval < 0)
                        goto ioerror;
-               (void)sprintf(resp, "A%d\n", rval);
+               (void)sprintf(resp, "A%lld\n", (long long)rval);
                (void)write(1, resp, strlen(resp));
                (void)write(1, record, rval);
                block += n >> 10;
@@ -347,7 +347,7 @@ top:
                  if (ioctl(tape, MTIOCGET, (char *)&mtget) < 0)
                        goto ioerror;
                  rval = sizeof (mtget);
-                 (void)sprintf(resp, "A%d\n", rval);
+                 (void)sprintf(resp, "A%lld\n", (long long)rval);
                  (void)write(1, resp, strlen(resp));
                  (void)write(1, (char *)&mtget, sizeof (mtget));
                  goto top;
@@ -407,8 +407,8 @@ top:
                exit(3);
        }
 respond:
-       DEBUG1("rmtd: A %d\n", rval);
-       (void)sprintf(resp, "A%d\n", rval);
+       DEBUG1("rmtd: A %lld\n", (long long)rval);
+       (void)sprintf(resp, "A%lld\n", (long long)rval);
        (void)write(1, resp, strlen(resp));
        goto top;
 ioerror: