mirror of https://gitee.com/bigwinds/arangodb
honor result of stat() call
This commit is contained in:
parent
ad05d8882b
commit
f7b56e33c9
|
@ -385,7 +385,11 @@ int TRI_Adler32(char const* filename, uint32_t& checksum) {
|
||||||
TRI_DEFER(TRI_CLOSE(fd));
|
TRI_DEFER(TRI_CLOSE(fd));
|
||||||
|
|
||||||
struct TRI_STAT statbuf;
|
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);
|
ssize_t chunkRemain = static_cast<TRI_read_t>(statbuf.st_size);
|
||||||
char* buf =
|
char* buf =
|
||||||
|
|
Loading…
Reference in New Issue