mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-16 17:25:13 +00:00
Fixed a bug(googlecode issue 405), enable_content_md5 Input/output error
This commit is contained in:
parent
36509351f0
commit
52d56d15e4
@ -3426,6 +3426,14 @@ unsigned char* md5hexsum(int fd, off_t start, ssize_t size)
|
|||||||
ssize_t bytes;
|
ssize_t bytes;
|
||||||
unsigned char* result;
|
unsigned char* result;
|
||||||
|
|
||||||
|
if(-1 == size){
|
||||||
|
struct stat st;
|
||||||
|
if(-1 == fstat(fd, &st)){
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
size = static_cast<ssize_t>(st.st_size);
|
||||||
|
}
|
||||||
|
|
||||||
// seek to top of file.
|
// seek to top of file.
|
||||||
if(-1 == lseek(fd, start, SEEK_SET)){
|
if(-1 == lseek(fd, start, SEEK_SET)){
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -3457,7 +3465,6 @@ unsigned char* md5hexsum(int fd, off_t start, ssize_t size)
|
|||||||
free(result);
|
free(result);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user