nfs-cp change uint64_t to size_t for the read/write wrappers
parent
2ff6131244
commit
8c8e615e54
|
@ -114,8 +114,8 @@ fstat_file(struct file_context *fc, struct stat *st)
|
|||
}
|
||||
}
|
||||
|
||||
static int64_t
|
||||
file_pread(struct file_context *fc, char *buf, int64_t count, uint64_t off)
|
||||
static ssize_t
|
||||
file_pread(struct file_context *fc, char *buf, size_t count, off_t off)
|
||||
{
|
||||
if (fc->is_nfs == 0) {
|
||||
lseek(fc->fd, off, SEEK_SET);
|
||||
|
@ -125,8 +125,8 @@ file_pread(struct file_context *fc, char *buf, int64_t count, uint64_t off)
|
|||
}
|
||||
}
|
||||
|
||||
static int64_t
|
||||
file_pwrite(struct file_context *fc, char *buf, int64_t count, uint64_t off)
|
||||
static ssize_t
|
||||
file_pwrite(struct file_context *fc, char *buf, size_t count, off_t off)
|
||||
{
|
||||
if (fc->is_nfs == 0) {
|
||||
lseek(fc->fd, off, SEEK_SET);
|
||||
|
@ -217,8 +217,8 @@ int main(int argc, char *argv[])
|
|||
struct stat st;
|
||||
struct file_context *src;
|
||||
struct file_context *dst;
|
||||
uint64_t off;
|
||||
int64_t count;
|
||||
off_t off;
|
||||
ssize_t count;
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
|
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
off = 0;
|
||||
while (off < st.st_size) {
|
||||
count = st.st_size - off;
|
||||
count = (size_t)(st.st_size - off);
|
||||
if (count > BUFSIZE) {
|
||||
count = BUFSIZE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue