}
-int read_int(int f)
+int32 read_int(int f)
{
int ret;
char b[4];
char b[8];
ret = read_int(f);
- if (ret != -1) return ret;
+ if ((int32)ret != (int32)0xffffffff) return ret;
-#ifndef HAVE_LONGLONG
+#ifdef NO_INT64
fprintf(FERROR,"Integer overflow - attempted 64 bit offset\n");
exit_cleanup(1);
#else
int sparse_end(int f)
{
if (last_sparse) {
- lseek(f,-1,SEEK_CUR);
+ do_lseek(f,-1,SEEK_CUR);
return (write(f,&last_byte,1) == 1 ? 0 : -1);
}
last_sparse = 0;
last_sparse=1;
if (l1 > 0)
- lseek(f,l1,SEEK_CUR);
+ do_lseek(f,l1,SEEK_CUR);
if (l1 == len)
return len;
}
if (l2 > 0)
- lseek(f,l2,SEEK_CUR);
+ do_lseek(f,l2,SEEK_CUR);
return len;
}
-void write_int(int f,int x)
+void write_int(int f,int32 x)
{
int ret;
char b[4];