Merge pull request #62954 from ClickHouse/mac-clang-18

Fix build on Mac using clang-18
This commit is contained in:
Nikita Mikhaylov 2024-04-25 10:42:28 +00:00 committed by GitHub
commit 0543312542
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,7 +132,9 @@ static PollPidResult pollPid(pid_t pid, int timeout_in_ms)
if (kq == -1)
return PollPidResult::FAILED;
struct kevent change = {.ident = 0};
struct kevent change;
change.ident = 0;
EV_SET(&change, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
int event_add_result = HANDLE_EINTR(kevent(kq, &change, 1, NULL, 0, NULL));
@ -144,7 +146,9 @@ static PollPidResult pollPid(pid_t pid, int timeout_in_ms)
return PollPidResult::FAILED;
}
struct kevent event = {.ident = 0};
struct kevent event;
event.ident = 0;
struct timespec remaining_timespec = {.tv_sec = timeout_in_ms / 1000, .tv_nsec = (timeout_in_ms % 1000) * 1000000};
int ready = HANDLE_EINTR(kevent(kq, nullptr, 0, &event, 1, &remaining_timespec));
PollPidResult result = ready < 0 ? PollPidResult::FAILED : PollPidResult::RESTART;