Skip to content

Instantly share code, notes, and snippets.

@crackcomm
Last active October 3, 2023 10:40
Show Gist options
  • Save crackcomm/5b84f1ff6950bdefa8d8cc2db18ea0f9 to your computer and use it in GitHub Desktop.
Save crackcomm/5b84f1ff6950bdefa8d8cc2db18ea0f9 to your computer and use it in GitHub Desktop.
diff --git a/src/core/reactor.cc b/src/core/reactor.cc
index 29090d3c..0d68e5c1 100644
--- a/src/core/reactor.cc
+++ b/src/core/reactor.cc
@@ -2851,7 +2851,7 @@ class reactor::syscall_pollfn final : public reactor::pollfn {
void
reactor::wakeup() {
uint64_t one = 1;
- ::write(_notify_eventfd.get(), &one, sizeof(one));
+ [[maybe_unused]] auto ret = ::write(_notify_eventfd.get(), &one, sizeof(one));
}
void reactor::start_aio_eventfd_loop() {
@@ -2861,7 +2861,7 @@ void reactor::start_aio_eventfd_loop() {
future<> loop_done = repeat([this] {
return _aio_eventfd->readable().then([this] {
char garbage[8];
- ::read(_aio_eventfd->get_fd(), garbage, 8); // totally uninteresting
+ [[maybe_unused]] auto ret = ::read(_aio_eventfd->get_fd(), garbage, 8); // totally uninteresting
return _stopping ? stop_iteration::yes : stop_iteration::no;
});
});
@@ -2876,7 +2876,7 @@ void reactor::stop_aio_eventfd_loop() {
return;
}
uint64_t one = 1;
- ::write(_aio_eventfd->get_fd(), &one, 8);
+ [[maybe_unused]] auto ret = ::write(_aio_eventfd->get_fd(), &one, 8);
}
inline
diff --git a/src/core/thread_pool.cc b/src/core/thread_pool.cc
index 2de02fd0..a89b1384 100644
--- a/src/core/thread_pool.cc
+++ b/src/core/thread_pool.cc
@@ -56,7 +56,7 @@ void thread_pool::work(sstring name) {
std::atomic_thread_fence(std::memory_order_seq_cst);
if (_main_thread_idle.load(std::memory_order_relaxed)) {
uint64_t one = 1;
- ::write(_reactor->_notify_eventfd.get(), &one, 8);
+ [[maybe_unused]] auto ret = ::write(_reactor->_notify_eventfd.get(), &one, 8);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment