mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-23 01:08:54 +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;
|
||||
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.
|
||||
if(-1 == lseek(fd, start, SEEK_SET)){
|
||||
return NULL;
|
||||
@ -3457,7 +3465,6 @@ unsigned char* md5hexsum(int fd, off_t start, ssize_t size)
|
||||
free(result);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user