From dd77b7358f08bcea5e5637e28c3647ec16d3177b Mon Sep 17 00:00:00 2001 From: Akshay Diddee Date: Wed, 27 Sep 2023 10:28:29 +0000 Subject: [PATCH] 1)Changing the order of the 2 STOPPED events. 2)Changing 'if(' to 'if (' --- daemon/lib/source/Dobby.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/daemon/lib/source/Dobby.cpp b/daemon/lib/source/Dobby.cpp index d1a3d4bc..e77fa47b 100644 --- a/daemon/lib/source/Dobby.cpp +++ b/daemon/lib/source/Dobby.cpp @@ -1856,24 +1856,25 @@ void Dobby::onContainerStopped(int32_t cd, const ContainerId& id, int status) // Regardless of whether of the not the hooks executed successfully // we fire off a notification event indicating that the container // has stopped. + + // Fire off a notification with status if (!mIpcService->emitSignal(AI_IPC::Signal(mObjectPath, DOBBY_CTRL_INTERFACE, - DOBBY_CTRL_EVENT_STOPPED), - { cd, id.str() })) + DOBBY_CTRL_EVENT_STOPPED_WITH_STATUS), + { cd, id.str(), int32_t(status) })) { AI_LOG_ERROR("failed to emit '%s' signal", - DOBBY_CTRL_EVENT_STOPPED); + DOBBY_CTRL_EVENT_STOPPED_WITH_STATUS); } - - //Fire off a notification with status - if(!mIpcService->emitSignal(AI_IPC::Signal(mObjectPath, + //Fire off a normal notification + if (!mIpcService->emitSignal(AI_IPC::Signal(mObjectPath, DOBBY_CTRL_INTERFACE, - DOBBY_CTRL_EVENT_STOPPED_WITH_STATUS), - { cd, id.str(), int32_t(status) })) + DOBBY_CTRL_EVENT_STOPPED), + { cd, id.str() })) { AI_LOG_ERROR("failed to emit '%s' signal", - DOBBY_CTRL_EVENT_STOPPED_WITH_STATUS); + DOBBY_CTRL_EVENT_STOPPED); } AI_LOG_MILESTONE("container '%s'(%d) stopped (status 0x%04x)", id.c_str(),