* 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.
*
#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.27 2003/03/30 15:40:33 stelian Exp $";
#endif /* not lint */
#include <config.h>
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 *));
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);
return (rmtcall("ioctl", buf));
}
-static int
+static OFF_T
rmtcall(const char *cmd, const char *buf)
{
return (rmtreply(cmd));
}
-static int
+static OFF_T
rmtreply(const char *cmd)
{
char *cp;
code);
rmtconnaborted(0);
}
- return (atoi(code + 1));
+ return (OFF_T)(atoll(code + 1));
}
static int