mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-05 12:27:53 +00:00
Merge pull request #19 from s3fs-fuse/test_md5
Fixed a bug(googlecode issue 405), enable_content_md5 Input/output error
This commit is contained in:
commit
39402696ce
@ -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