diff options
Diffstat (limited to 'softoff/mainapp.cpp')
-rw-r--r-- | softoff/mainapp.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/softoff/mainapp.cpp b/softoff/mainapp.cpp index 3a47cc4..3b153a8 100644 --- a/softoff/mainapp.cpp +++ b/softoff/mainapp.cpp @@ -13,13 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "config.h" + +#include "softoff.hpp" +#include "timer.hpp" + #include <systemd/sd-event.h> -#include <phosphor-logging/elog.hpp> + #include <phosphor-logging/elog-errors.hpp> +#include <phosphor-logging/elog.hpp> #include <xyz/openbmc_project/State/Host/error.hpp> -#include "softoff.hpp" -#include "config.h" -#include "timer.hpp" // Return -1 on any errors to ensure we follow the calling targets OnFailure= // path @@ -41,7 +44,7 @@ int main(int argc, char** argv) if (r < 0) { log<level::ERR>("Failure to create sd_event handler", - entry("ERRNO=0x%X", -r)); + entry("ERRNO=0x%X", -r)); return -1; } @@ -58,22 +61,23 @@ int main(int argc, char** argv) // Wait for client requests until this application has processed // at least one successful SoftPowerOff or we timed out - while(!powerObj.isCompleted() && !powerObj.isTimerExpired()) + while (!powerObj.isCompleted() && !powerObj.isTimerExpired()) { // -1 denotes wait for ever r = sd_event_run(events, (uint64_t)-1); if (r < 0) { log<level::ERR>("Failure in processing request", - entry("ERRNO=0x%X", -r)); + entry("ERRNO=0x%X", -r)); return -1; } } // Log an error if we timed out after getting Ack for SMS_ATN and before // getting the Host Shutdown response - if(powerObj.isTimerExpired() && (powerObj.responseReceived() == - phosphor::ipmi::Base::SoftPowerOff::HostResponse::SoftOffReceived)) + if (powerObj.isTimerExpired() && + (powerObj.responseReceived() == + phosphor::ipmi::Base::SoftPowerOff::HostResponse::SoftOffReceived)) { using error = sdbusplus::xyz::openbmc_project::State::Host::Error::SoftOffTimeout; |