sd_event_wrapper must not close descriptor
The underlying sd_event checks to see that the file descriptor is good
before calling close, so if the sd_event_wrapper closes the descriptor
first, sd_event calls assert(). The release() mechanism allows the
sd_event to close out the descriptor on its own.
Change-Id: Icb8ca5ba909478361a90253713a425256556d140
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/sdbusplus/asio/sd_event.hpp b/sdbusplus/asio/sd_event.hpp
index 747c240..14ade7c 100644
--- a/sdbusplus/asio/sd_event.hpp
+++ b/sdbusplus/asio/sd_event.hpp
@@ -52,6 +52,9 @@
}
~sd_event_wrapper()
{
+ // sd_event really wants to close the descriptor on its own
+ // so this class must merely release it
+ descriptor.release();
sd_event_unref(evt);
}
// process one event step in the queue