Skip to content

Commit d39a1e5

Browse files
committed
Fix location of printing out error message in utils_mmap_file()
It was printed out in a wrong place. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 508162e commit d39a1e5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/utils/utils_linux_common.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ void *utils_mmap_file(void *hint_addr, size_t length, int prot, int flags,
8686
return addr;
8787
}
8888

89-
LOG_PERR("mapping file with the MAP_SYNC flag failed (fd=%i, offset=%zu, "
90-
"length=%zu, flags=%i)",
91-
fd, fd_offset, length, sync_flags);
92-
9389
/* try to mmap with MAP_SHARED flag (without MAP_SYNC) */
9490
if (errno == EINVAL || errno == ENOTSUP || errno == EOPNOTSUPP) {
9591
const int shared_flags = flags | MAP_SHARED;
@@ -104,6 +100,11 @@ void *utils_mmap_file(void *hint_addr, size_t length, int prot, int flags,
104100
LOG_PERR("mapping file with the MAP_SHARED flag failed (fd=%i, "
105101
"offset=%zu, length=%zu, flags=%i)",
106102
fd, fd_offset, length, shared_flags);
103+
} else {
104+
LOG_PERR(
105+
"mapping file with the MAP_SYNC flag failed (fd=%i, offset=%zu, "
106+
"length=%zu, flags=%i)",
107+
fd, fd_offset, length, sync_flags);
107108
}
108109

109110
return NULL;

0 commit comments

Comments
 (0)