softoff: Don't return error completion code if PDR not found

System Firmware has not implemented effecter for handling softoff.
To handle that gracefully, as well as the scenario in which PDR exchange
has not happened, the softoff application will exit gracefully in either
scenarios.

Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Change-Id: I09478b5f0c8b87ce639f238035e7fb0513ffff7e
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index c2f2051..939d0e0 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -41,7 +41,13 @@
     }
 
     rc = getEffecterID();
-    if (rc != PLDM_SUCCESS)
+    if (completed)
+    {
+        std::cerr
+            << "pldm-softpoweroff: effecter to initiate softoff not found \n";
+        return;
+    }
+    else if (rc != PLDM_SUCCESS)
     {
         hasError = true;
         return;
@@ -203,6 +209,7 @@
     {
         std::cerr << "PLDM soft off: Error get system firmware PDR,ERROR="
                   << e.what() << "\n";
+        completed = true;
         return PLDM_ERROR;
     }