}
static void
-initNonStandardTags()
+initNonStandardTags(void)
{
RegisterTag(0, 'n'); /* volume name */
RegisterTag(0, 't'); /* fromtime, V_backupDate */
*length = len;
else {
len &= 0x7f;
- if (code = iod_Read(iodp, buf, len) != len)
+ if ((code = iod_Read(iodp, (char *)buf, len)) != len)
return VOLSERDUMPERROR;
*length = 0;
p = (unsigned char *)&buf;
SkipData(register struct iod *iodp, afs_size_t length)
{
while (length > 256) {
- if (iod_Read(iodp, &skipbuf, 256) != 256)
+ if (iod_Read(iodp, (char *)&skipbuf, 256) != 256)
return 0;
length -= 256;
}
- if (iod_Read(iodp, &skipbuf, length) != length)
+ if (iod_Read(iodp, (char *)&skipbuf, length) != length)
return 0;
return 1;
}
static char *secname[3] = {"ReadDumpHeader", "ReadVolumeHeader", "ReadVnodes"};
static int
-HandleUnknownTag(struct iod *iodp, register tag, afs_int32 section,
+HandleUnknownTag(struct iod *iodp, int tag, afs_int32 section,
afs_int32 critical)
{
- afs_size_t taglen;
+ afs_size_t taglen = 0;
afs_uint32 trash;
if (critical) {
return 0;
}
+AFS_UNUSED
static afs_int32
DumpStandardTagLen(register struct iod *iodp, char tag, afs_uint32 section,
afs_size_t length)
afs_sfsize_t n, nbytes, howMany, howBig;
afs_foff_t lcode = 0;
byte *p;
+ afs_uint32 hi, lo;
#ifndef AFS_NT40_ENV
struct afs_stat status;
#endif
afs_sfsize_t size;
#ifdef AFS_AIX_ENV
#include <sys/statfs.h>
-#if defined(AFS_AIX52_ENV) && defined(AFS_LARGEFILE_ENV)
+#if defined(AFS_AIX52_ENV)
struct statfs64 tstatfs;
-#else /* !AFS_AIX52_ENV || !AFS_LARGEFILE_ENV */
+#else /* !AFS_AIX52_ENV */
struct statfs tstatfs;
-#endif /* !AFS_AIX52_ENV || !AFS_LARGEFILE_ENV */
+#endif /* !AFS_AIX52_ENV */
int statfs_code;
#endif
/* Unfortunately in AIX valuable fields such as st_blksize are
* gone from the stat structure.
*/
-#if defined(AFS_AIX52_ENV) && defined(AFS_LARGEFILE_ENV)
+#if defined(AFS_AIX52_ENV)
statfs_code = fstatfs64(handleP->fd_fd, &tstatfs);
-#else /* !AFS_AIX52_ENV || !AFS_LARGEFILE_ENV */
+#else /* !AFS_AIX52_ENV */
statfs_code = fstatfs(handleP->fd_fd, &tstatfs);
-#endif /* !AFS_AIX52_ENV || !AFS_LARGEFILE_ENV */
+#endif /* !AFS_AIX52_ENV */
if (statfs_code != 0) {
Log("DumpFile: fstatfs returned error code %d on descriptor %d\n", errno, handleP->fd_fd);
return VOLSERDUMPERROR;
size = FDH_SIZE(handleP);
-#ifdef AFS_LARGEFILE_ENV
- {
- afs_uint32 hi, lo;
- SplitInt64(size, hi, lo);
- if (hi == 0L) {
- code = DumpInt32(iodp, 'f', lo);
- } else {
- code = DumpDouble(iodp, 'h', hi, lo);
- }
+ SplitInt64(size, hi, lo);
+ if (hi == 0L) {
+ code = DumpInt32(iodp, 'f', lo);
+ } else {
+ code = DumpDouble(iodp, 'h', hi, lo);
}
-#else /* !AFS_LARGEFILE_ENV */
- code = DumpInt32(iodp, 'f', size);
-#endif /* !AFS_LARGEFILE_ENV */
if (code) {
return VOLSERDUMPERROR;
}
/* Record the read error */
if (n < 0) {
n = 0;
- Log("1 Volser: DumpFile: Error %d reading inode %s for vnode %d\n", errno, PrintInode(NULL, handleP->fd_ih->ih_ino), vnode);
+ Log("1 Volser: DumpFile: Error reading inode %s for vnode %d: %s\n", PrintInode(NULL, handleP->fd_ih->ih_ino), vnode, afs_error_message(errno));
} else if (!pad) {
Log("1 Volser: DumpFile: Error reading inode %s for vnode %d\n", PrintInode(NULL, handleP->fd_ih->ih_ino), vnode);
}
lcode = FDH_SEEK(handleP, (size_t)((size - nbytes) + howMany), SEEK_SET);
if (lcode != ((size - nbytes) + howMany)) {
if (lcode < 0) {
- Log("1 Volser: DumpFile: Error %d seeking in inode %s for vnode %d\n", errno, PrintInode(NULL, handleP->fd_ih->ih_ino), vnode);
+ Log("1 Volser: DumpFile: Error seeking in inode %s for vnode %d: %s\n", PrintInode(NULL, handleP->fd_ih->ih_ino), vnode, afs_error_message(errno));
} else {
Log("1 Volser: DumpFile: Error seeking in inode %s for vnode %d\n", PrintInode(NULL, handleP->fd_ih->ih_ino), vnode);
lcode = -1;
FDH_CLOSE(fdP);
return -1;
}
- memset((char *)Buf, 0, nVnodes * sizeof(afs_int32));
+ memset(Buf, 0, nVnodes * sizeof(afs_int32));
STREAM_SEEK(afile, offset = vcp->diskSize, 0);
while (1) {
code = STREAM_READ(vnode, vcp->diskSize, 1, afile);
VAclDiskSize(vnode));
acl_NtohACL(VVnodeDiskACL(vnode));
break;
-#ifdef AFS_LARGEFILE_ENV
case 'h':
-#endif
case 'f':{
Inode ino;
Error error;
if (haveStuff) {
FdHandle_t *fdP = IH_OPEN(vp->vnodeIndex[class].handle);
if (fdP == NULL) {
- Log("1 Volser: ReadVnodes: Error opening vnode index; restore aborted\n");
+ Log("1 Volser: ReadVnodes: Error opening vnode index: %s; restore aborted\n",
+ afs_error_message(errno));
return VOLSERREAD_DUMPERROR;
}
if (FDH_SEEK(fdP, vnodeIndexOffset(vcp, vnodeNumber), SEEK_SET) <
0) {
- Log("1 Volser: ReadVnodes: Error seeking into vnode index; restore aborted\n");
+ Log("1 Volser: ReadVnodes: Error seeking into vnode index: %s; restore aborted\n",
+ afs_error_message(errno));
FDH_REALLYCLOSE(fdP);
return VOLSERREAD_DUMPERROR;
}
vnode->vnodeMagic = vcp->magic;
if (FDH_SEEK(fdP, vnodeIndexOffset(vcp, vnodeNumber), SEEK_SET) <
0) {
- Log("1 Volser: ReadVnodes: Error seeking into vnode index; restore aborted\n");
+ Log("1 Volser: ReadVnodes: Error seeking into vnode index: %s; restore aborted\n",
+ afs_error_message(errno));
FDH_REALLYCLOSE(fdP);
return VOLSERREAD_DUMPERROR;
}
if (FDH_WRITE(fdP, vnode, vcp->diskSize) != vcp->diskSize) {
- Log("1 Volser: ReadVnodes: Error writing vnode index; restore aborted\n");
+ Log("1 Volser: ReadVnodes: Error writing vnode index: %s; restore aborted\n",
+ afs_error_message(errno));
FDH_REALLYCLOSE(fdP);
return VOLSERREAD_DUMPERROR;
}
#ifdef AFS_64BIT_ENV
{
afs_uint32 filesize_high = 0L, filesize_low = 0L;
-#ifdef AFS_LARGEFILE_ENV
if (tag == 'h') {
if (!ReadInt32(iodp, &filesize_high)) {
*status = 1;
return 0;
}
}
-#endif /* !AFS_LARGEFILE_ENV */
if (!ReadInt32(iodp, &filesize_low)) {
*status = 1;
return 0;
size = nbytes;
if ((code = iod_Read(iodp, (char *) p, size)) != size) {
- Log("1 Volser: WriteFile: Error reading dump file %d size=%llu nbytes=%u (%d of %u); restore aborted\n", vn, (afs_uintmax_t) filesize, nbytes, code, size);
+ Log("1 Volser: WriteFile: Error reading dump file %d size=%llu nbytes=%u (%d of %u): %s; restore aborted\n", vn, (afs_uintmax_t) filesize, nbytes, code, size, afs_error_message(errno));
*status = 3;
break;
}
if (lcode > 0)
written += lcode;
if (lcode != size) {
- Log("1 Volser: WriteFile: Error writing (%d,%u) bytes to vnode %d; restore aborted\n", (int)(lcode>>32), (int)(lcode & 0xffffffff), vn);
+ Log("1 Volser: WriteFile: Error writing (%d,%u) bytes to vnode %d: %s; restore aborted\n", (int)(lcode>>32), (int)(lcode & 0xffffffff), vn, afs_error_message(errno));
*status = 4;
break;
}