summaryrefslogtreecommitdiffstats
path: root/fastos
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-19 13:09:22 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-19 13:09:22 +0100
commitb20154fd8d9222ce74312aad903c55fea21b7ce2 (patch)
tree94e14956d3433b9b8bc0c41ab8de8a30436d780b /fastos
parent1c00ff436c04161d8a667e310d067b4696da69c4 (diff)
Less us not overdo the casting ...
Diffstat (limited to 'fastos')
-rw-r--r--fastos/src/vespa/fastos/unix_file.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fastos/src/vespa/fastos/unix_file.cpp b/fastos/src/vespa/fastos/unix_file.cpp
index 2dffec5595f..9938647a5a7 100644
--- a/fastos/src/vespa/fastos/unix_file.cpp
+++ b/fastos/src/vespa/fastos/unix_file.cpp
@@ -205,11 +205,11 @@ FastOS_UNIX_File::Open(unsigned int openFlags, const char *filename)
int64_t filesize = GetSize();
size_t mlen = static_cast<size_t>(filesize);
if ((static_cast<int64_t>(mlen) == filesize) && (mlen > 0)) {
- void *mbase = mmap(nullptr, mlen, PROT_READ, MAP_SHARED | _mmapFlags, _filedes, static_cast<off_t>(0));
- if (static_cast<void *>(mbase) == reinterpret_cast<void *>(-1)) {
- mbase = mmap(nullptr, mlen, PROT_READ, MAP_SHARED | (_mmapFlags & SUPPORTED_MMAP_FLAGS), _filedes, static_cast<off_t>(0));
+ void *mbase = mmap(nullptr, mlen, PROT_READ, MAP_SHARED | _mmapFlags, _filedes, 0);
+ if (mbase == reinterpret_cast<void *>(-1)) {
+ mbase = mmap(nullptr, mlen, PROT_READ, MAP_SHARED | (_mmapFlags & SUPPORTED_MMAP_FLAGS), _filedes, 0);
}
- if (static_cast<void *>(mbase) != reinterpret_cast<void *>(-1)) {
+ if (mbase != reinterpret_cast<void *>(-1)) {
int fadviseOptions = getFAdviseOptions();
int eCode(0);
if (POSIX_FADV_RANDOM == fadviseOptions) {