Skip to content

Commit

Permalink
[C] Tidy up after merge of PR #1360.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Sep 14, 2022
1 parent 75de086 commit 6e0480f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions aeron-client/src/main/c/util/aeron_fileutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define AERON_NATIVE_PRETOUCH
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
Expand Down Expand Up @@ -117,7 +116,7 @@ int aeron_ftruncate(int fd, size_t length)
{
HANDLE hfile = (HANDLE)_get_osfhandle(fd);
LARGE_INTEGER file_size;
file_size.QuadPart = (long long)length;
file_size.QuadPart = (LONGLONG)length;

if (!SetFilePointerEx(hfile, file_size, NULL, FILE_BEGIN))
{
Expand Down Expand Up @@ -510,7 +509,7 @@ int aeron_raw_log_map_existing(aeron_mapped_raw_log_t *mapped_raw_log, const cha
const int64_t file_length = aeron_file_length(path);
if (-1 != file_length)
{
mapped_raw_log->mapped_file.length =file_length;
mapped_raw_log->mapped_file.length = file_length;

if (0 != aeron_mmap(&mapped_raw_log->mapped_file, fd, pre_touch))
{
Expand Down
2 changes: 1 addition & 1 deletion aeron-client/src/test/c/util/aeron_fileutil_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ TEST_F(FileUtilTest, rawLogMapExistingShouldHandleMaxTermBufferLength)
aeron_mapped_raw_log_t mapped_raw_log = {};
const char *file = "test_raw_log_map_existing_file_max_buffer_length.log";
const size_t file_length = 3223322624;
const size_t term_length = (size_t)AERON_LOGBUFFER_TERM_MAX_LENGTH;
const size_t term_length = AERON_LOGBUFFER_TERM_MAX_LENGTH;
const size_t page_size = 2 * 1024 * 1024;
ASSERT_EQ(0, aeron_raw_log_map(&mapped_raw_log, file, true, term_length, page_size)) << aeron_errmsg();
auto logbuffer_metadata = (aeron_logbuffer_metadata_t *)(mapped_raw_log.log_meta_data.addr);
Expand Down

0 comments on commit 6e0480f

Please sign in to comment.