summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-06-22 19:41:42 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-07-09 18:20:42 +0000
commit433251844f5af05eb7e966951cdea34c8237fc24 (patch)
tree71447df92ef36d1f5655d13880f56229bf06d0c8
parent2726c17ebb854a1f134b82b63b03f307b5e0b3d8 (diff)
downloadsdbusplus-433251844f5af05eb7e966951cdea34c8237fc24.tar.gz
sdbusplus-433251844f5af05eb7e966951cdea34c8237fc24.zip
SdBusError: Fix missing move
Our move operator and constructor currently forgets that it needs to also move the value of the system_error. It also needs to initialize the error member since the move function will first free the current error. Tested: Builds still work and existing tests pass. Change-Id: I72fcd2d10eeedf6edf6f83c10ddaf15bb42c8b0d Signed-off-by: William A. Kennington III <wak@google.com>
-rw-r--r--sdbusplus/exception.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sdbusplus/exception.cpp b/sdbusplus/exception.cpp
index 2bb3576..f13ba86 100644
--- a/sdbusplus/exception.cpp
+++ b/sdbusplus/exception.cpp
@@ -40,7 +40,8 @@ SdBusError::SdBusError(sd_bus_error* error, const char* prefix,
populateMessage(prefix);
}
-SdBusError::SdBusError(SdBusError&& other)
+SdBusError::SdBusError(SdBusError&& other) :
+ std::system_error(std::move(other)), error(SD_BUS_ERROR_NULL)
{
move(std::move(other));
}
@@ -49,6 +50,7 @@ SdBusError& SdBusError::operator=(SdBusError&& other)
{
if (this != &other)
{
+ std::system_error::operator=(std::move(other));
move(std::move(other));
}
return *this;
OpenPOWER on IntegriCloud