Suppress spurious SHA256 error message (#1544)

This commit is contained in:
Andrew Gaul 2021-02-04 07:28:51 +09:00 committed by GitHub
parent ed85b72bf5
commit 4b53d4bf6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -2595,7 +2595,7 @@ void S3fsCurl::insertV4Headers()
break;
}
if(0 == payload_hash.length()){
if(b_infile != NULL && 0 == payload_hash.length()){
S3FS_PRN_ERR("Failed to make SHA256.");
// TODO: propagate error
}

View File

@ -321,9 +321,13 @@ unsigned char* s3fs_sha256_fd(int fd, off_t start, off_t size)
off_t bytes;
unsigned char* result;
if(-1 == fd){
return NULL;
}
if(-1 == size){
struct stat st;
if(-1 == fstat(fd, &st)){
S3FS_PRN_ERR("fstat error(%d)", errno);
return NULL;
}
size = st.st_size;