mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #34617 from Algunenano/freebsd_build
Attempt to fix freeBSD build
This commit is contained in:
commit
724340418e
@ -539,14 +539,14 @@ catch (...)
|
||||
|
||||
struct DiskWriteCheckData
|
||||
{
|
||||
constexpr static size_t PAGE_SIZE = 4096;
|
||||
char data[PAGE_SIZE]{};
|
||||
constexpr static size_t PAGE_SIZE_IN_BYTES = 4096;
|
||||
char data[PAGE_SIZE_IN_BYTES]{};
|
||||
DiskWriteCheckData()
|
||||
{
|
||||
static const char * magic_string = "ClickHouse disk local write check";
|
||||
static size_t magic_string_len = strlen(magic_string);
|
||||
memcpy(data, magic_string, magic_string_len);
|
||||
memcpy(data + PAGE_SIZE - magic_string_len, magic_string, magic_string_len);
|
||||
memcpy(data + PAGE_SIZE_IN_BYTES - magic_string_len, magic_string, magic_string_len);
|
||||
}
|
||||
};
|
||||
|
||||
@ -557,7 +557,7 @@ try
|
||||
String tmp_template = fs::path(disk_path) / "";
|
||||
{
|
||||
auto buf = WriteBufferFromTemporaryFile::create(tmp_template);
|
||||
buf->write(data.data, data.PAGE_SIZE);
|
||||
buf->write(data.data, data.PAGE_SIZE_IN_BYTES);
|
||||
buf->sync();
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user