From d001dde47cc0df44ad79aa19bfe5bafaf4ba31bd Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 7 Aug 2019 10:51:41 +0200 Subject: [PATCH] bindings: cxx: add a missing throw to line::event_get_fd() If the call to gpiod_line_event_get_fd() fails, we're not actually throwing the exception - we're only creating it on stack. Add the missing throw keyword. Fixes: 8078a4a2ad90 ("bindings: implement C++ bindings") Signed-off-by: Bartosz Golaszewski --- bindings/cxx/line.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/cxx/line.cpp b/bindings/cxx/line.cpp index 989976e..4ccbd15 100644 --- a/bindings/cxx/line.cpp +++ b/bindings/cxx/line.cpp @@ -183,8 +183,8 @@ int line::event_get_fd(void) const int ret = ::gpiod_line_event_get_fd(this->_m_line); if (ret < 0) - ::std::system_error(errno, ::std::system_category(), - "unable to get the line event file descriptor"); + throw ::std::system_error(errno, ::std::system_category(), + "unable to get the line event file descriptor"); return ret; } -- 2.30.2