#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.62 2002/05/21 15:48:46 stelian Exp $";
+ "$Id: tape.c,v 1.64 2002/07/29 12:00:34 stelian Exp $";
#endif /* not lint */
#include <config.h>
#ifdef RRESTORE
if (host)
- mt = rmtopen(temptape, "O_RDONLY");
+ mt = rmtopen(temptape, O_RDONLY);
else
#endif
if (pipein)
if (vflag || command == 't' || command == 'C')
printdumpinfo();
#ifdef USE_QFA
- if (tapeposflag && spcl.c_date != qfadumpdate)
+ if (tapeposflag && (unsigned long)spcl.c_date != qfadumpdate)
errx(1, "different QFA/dumpdates detected\n");
#endif
if (filesys[0] == '\0') {
}
#ifdef RRESTORE
if (host)
- mt = rmtopen(magtape, "O_RDONLY");
+ mt = rmtopen(magtape, O_RDONLY);
else
#endif
mt = OPEN(magtape, O_RDONLY, 0);
if (volinfo[1] == ROOTINO) {
printf("Starting inode numbers by volume:\n");
- for (i = 1; i < TP_NINOS && volinfo[i] != 0; ++i)
+ for (i = 1; i < (int)TP_NINOS && volinfo[i] != 0; ++i)
printf("\tVolume %d: %lu\n", i, (unsigned long)volinfo[i]);
}
}
*/
/* ARGSUSED */
static void
-xtrskip(char *buf, size_t size)
+xtrskip(UNUSED(char *buf), size_t size)
{
if (LSEEK(ofile, (off_t)size, SEEK_CUR) == -1)
*/
/* ARGSUSED */
static void
-xtrlnkskip(char *buf, size_t size)
+xtrlnkskip(UNUSED(char *buf), UNUSED(size_t size))
{
errx(1, "unallocated block in symbolic link %s", curfile.name);
*/
/* ARGSUSED */
static void
-xtrmapskip(char *buf, size_t size)
+xtrmapskip(UNUSED(char *buf), size_t size)
{
panic("hole in map\n");
*/
/* ARGSUSED */
void
-xtrnull(char *buf, size_t size)
+xtrnull(UNUSED(char *buf), UNUSED(size_t size))
{
return;
if (cmperror)
return;
- if (read(ifile, cmpbuf, size) != size) {
+ if (read(ifile, cmpbuf, size) != (ssize_t)size) {
fprintf(stderr, "%s: size has changed.\n",
curfile.name);
cmperror = 1;
* Skip over a hole in a file.
*/
static void
-xtrcmpskip(char *buf, size_t size)
+xtrcmpskip(UNUSED(char *buf), size_t size)
{
static char cmpbuf[MAXBSIZE];
int i;
if (cmperror)
return;
- if (read(ifile, cmpbuf, size) != size) {
+ if (read(ifile, cmpbuf, size) != (ssize_t)size) {
fprintf(stderr, "%s: size has changed.\n",
curfile.name);
cmperror = 1;
return;
}
- for (i = 0; i < size; ++i)
+ for (i = 0; i < (int)size; ++i)
if (cmpbuf[i] != '\0') {
fprintf(stderr, "%s: tape and disk copies are different\n",
curfile.name);
void
comparefile(char *name)
{
- int mode;
+ unsigned int mode;
struct STAT sb;
int r;
#if !COMPARE_ONTHEFLY
return;
}
- if (sb.st_rdev != (int)curfile.dip->di_rdev) {
+ if (sb.st_rdev != (dev_t)curfile.dip->di_rdev) {
fprintf(stderr,
"%s: device changed from %d,%d to %d,%d.\n",
name,
/* read the block prefix */
ret = read_a_block(mt, tapebuf, PREFIXSIZE, &rl);
- if (Vflag && (ret == 0 || rl < PREFIXSIZE || tpb->length == 0))
+ if (Vflag && (ret == 0 || rl < (int)PREFIXSIZE || tpb->length == 0))
ret = 0;
if (ret <= 0)
goto readerr;
/* build a length error message */
blocklen = tpbin->length;
- if (readsize < blocklen + PREFIXSIZE)
+ if (readsize < blocklen + (int)PREFIXSIZE)
lengtherr = "short";
else
- if (readsize > blocklen + PREFIXSIZE)
+ if (readsize > blocklen + (int)PREFIXSIZE)
lengtherr = "long";
worklen = comprlen;
len = bufsize - TP_BSIZE;
}
if (read_a_block(mt, tapebuf+TP_BSIZE, len, &i) < 0
- || (i != len && i % TP_BSIZE != 0))
+ || (i != (long)len && i % TP_BSIZE != 0))
errx(1,"Error reading dump file header");
tbufptr = tapebuf;
numtrec = ntrec;