diff --git a/arangod/VocBase/datafile.cpp b/arangod/VocBase/datafile.cpp index 59bbc1c088..7732240db1 100644 --- a/arangod/VocBase/datafile.cpp +++ b/arangod/VocBase/datafile.cpp @@ -146,7 +146,7 @@ static int TruncateDatafile (TRI_datafile_t* const datafile, const off_t length) static int CreateSparseFile (char const* filename, const TRI_voc_size_t maximalSize) { - off_t offset; + TRI_lseek_t offset; char zero; ssize_t res; int fd; @@ -162,9 +162,9 @@ static int CreateSparseFile (char const* filename, } // create sparse file - offset = TRI_LSEEK(fd, maximalSize - 1, SEEK_SET); + offset = TRI_LSEEK(fd, (TRI_lseek_t) (maximalSize - 1), SEEK_SET); - if (offset == (off_t) -1) { + if (offset == (TRI_lseek_t) -1) { TRI_set_errno(TRI_ERROR_SYS_ERROR); TRI_CLOSE(fd); @@ -192,7 +192,6 @@ static int CreateSparseFile (char const* filename, return fd; } - //////////////////////////////////////////////////////////////////////////////// /// @brief initialises a datafile //////////////////////////////////////////////////////////////////////////////// @@ -266,7 +265,6 @@ static int TruncateAndSealDatafile (TRI_datafile_t* datafile, int fd; int res; size_t maximalSize; - off_t offset; void* data; void* mmHandle; @@ -295,9 +293,9 @@ static int TruncateAndSealDatafile (TRI_datafile_t* datafile, } // create sparse file - offset = TRI_LSEEK(fd, (TRI_lseek_t) maximalSize - 1, SEEK_SET); + TRI_lseek_t offset = TRI_LSEEK(fd, (TRI_lseek_t) (maximalSize - 1), SEEK_SET); - if (offset == (off_t) -1) { + if (offset == (TRI_lseek_t) -1) { TRI_set_errno(TRI_ERROR_SYS_ERROR); TRI_CLOSE(fd);