Conditionally clear watchdog pre-timeout interrupt

"Clear Message Flags" IPMI command is used to clear the Event Message
buffer, Receive Message queue and Watchdog pre-timeout interrupt flag
if that specific BIT is set.

Existing code is setting the "Watchdog Pre-timeout interrupt" flag to
True when user (host/end user) tries to clear other bits like Message
Buffer or Receive Message Queue which is not correct. So correct the
condition to clear "watchdog Pre-timeout interrupt" flag only if BIT 3
is set.

Tested:
Verified using cmdtool utility and clear linux OS.

On Cmdtool-
Case 1: When "PreTimeoutInterruptOccurFlag" flag is enable and clear
other flags
Command: > cmdtool.efi 20 18 31 //Get Message Flags
Response: 00 08
Command: > cmdtool.efi 20 18 30 2 //Clear Message Flags
Response: 00
Command: > cmdtool.efi 20 18 31 //Get Message Flags
Response: 00 08    //watchdog "PreTimeoutInterruptOccurFlag" is not
                    //cleared

Case 2: When "PreTimeoutInterruptOccurFlag" flag is enable and clear
PreTimeoutInterruptOccurFlag
Command: > cmdtool.efi 20 18 30 8 //Clear Message Flags
Response: 00
Command: > cmdtool.efi 20 18 31 //Get Message Flags
Response: 00 02   //watchdog "PreTimeoutInterruptOccurFlag" is not
                  //cleared

On Linux OS-
Case 1: When "PreTimeoutInterruptOccurFlag" flag is enable and clear
other flags
Command: ipmitool raw 0x06 0x31 //get message flags
Response: 08
Command: ipmitool raw 0x06 0x30 0x02 // clear message flags
Response:              //Success
Command: ipmitool raw 0x06 0x31 //get message flags
Response: 08

Case 2: When "PreTimeoutInterruptOccurFlag" flag is enable and clear
PreTimeoutInterruptOccurFlag
Command: ipmitool raw 0x06 0x30 0x08 // clear message flags
Response:              //Success
Command: ipmitool raw 0x06 0x31 //get message flags
Response: 02

Signed-off-by: JitendraKumar Tripathy
<jitendra.kumarx.tripathy@intel.com>
Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I85a742c6d5799fe31b4c0a64b3d4f62256772be6
diff --git a/src/bridgingcommands.cpp b/src/bridgingcommands.cpp
index 7ae513c..c110563 100644
--- a/src/bridgingcommands.cpp
+++ b/src/bridgingcommands.cpp
@@ -660,9 +660,12 @@
 
     try
     {
-        std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus();
-        ipmi::setDbusProperty(*dbus, wdtService, wdtObjPath, wdtInterface,
-                              wdtInterruptFlagProp, watchdogTimeout);
+        if (watchdogTimeout)
+        {
+            std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus();
+            ipmi::setDbusProperty(*dbus, wdtService, wdtObjPath, wdtInterface,
+                                  wdtInterruptFlagProp, false);
+        }
     }
     catch (const sdbusplus::exception::exception& e)
     {