]> git.wh0rd.org - dump.git/blobdiff - common/dumprmt.c
Relicensed dump/restore under the revised BSD license, as per ftp://ftp.cs.berkeley...
[dump.git] / common / dumprmt.c
index 699122f4349d666fb21c3719a03958f0ed8fe58e..eb61a55c9a4ced0db589b507249058fa887ca6b8 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -41,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dumprmt.c,v 1.25 2003/02/12 11:02:29 stelian Exp $";
+       "$Id: dumprmt.c,v 1.27 2003/03/30 15:40:33 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -350,7 +346,15 @@ rmtstatus(void)
 
        if (rmtstate != TS_OPEN)
                return (NULL);
-       rmtcall("status", "S\n");
+       i = rmtcall("status", "S");
+       if (i < 0) return NULL;
+       if (i != (int)sizeof(mts)) {
+               msg("mtget sizes different between host (%d) "
+                   "and remote tape (%d)", sizeof(mts), i);
+               for ( /* empty */; i > 0; --i)
+                       rmtgetb();
+               return NULL;
+       }
        for (i = 0, cp = (char *)&mts; i < (int)sizeof(mts); i++)
                *cp++ = rmtgetb();
        return (&mts);