1
0
Fork 0

honor result of stat() call

This commit is contained in:
jsteemann 2017-06-07 13:21:07 +02:00
parent ad05d8882b
commit f7b56e33c9
1 changed files with 5 additions and 1 deletions

View File

@ -385,7 +385,11 @@ int TRI_Adler32(char const* filename, uint32_t& checksum) {
TRI_DEFER(TRI_CLOSE(fd));
struct TRI_STAT statbuf;
TRI_FSTAT(fd, &statbuf);
int res = TRI_FSTAT(fd, &statbuf);
if (res < 0) {
TRI_SYSTEM_ERROR();
return TRI_set_errno(TRI_ERROR_SYS_ERROR);
}
ssize_t chunkRemain = static_cast<TRI_read_t>(statbuf.st_size);
char* buf =