From 18d7b4c8b4b4eba3eb645da6e062b76efdf01b12 Mon Sep 17 00:00:00 2001 From: Jonathan Maw Date: Fri, 3 Aug 2012 14:31:57 +0100 Subject: [PATCH] Make shutdown mode registration similar in NSC and helper binary The shutdown mode checker in the Node Startup Controller now uses the same logging message as the legacy app handler helper binary. The shutdown mode checker in the helper binary now uses the condition statement from the Node Startup Controller --- legacy-app-handler/main.c | 6 +++--- node-startup-controller/la-handler-service.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/legacy-app-handler/main.c b/legacy-app-handler/main.c index 66d7f3e..b020df9 100644 --- a/legacy-app-handler/main.c +++ b/legacy-app-handler/main.c @@ -108,9 +108,9 @@ main (int argc, } /* validate the shutdown mode */ - if (shutdown_mode == NSM_SHUTDOWN_TYPE_NOT - || ((shutdown_mode & NSM_SHUTDOWN_TYPE_NORMAL) == 0 - && (shutdown_mode & NSM_SHUTDOWN_TYPE_FAST) == 0)) + if (shutdown_mode != NSM_SHUTDOWN_TYPE_NORMAL + && shutdown_mode != NSM_SHUTDOWN_TYPE_FAST + && shutdown_mode != NSM_SHUTDOWN_TYPE_NORMAL | NSM_SHUTDOWN_TYPE_FAST) { DLT_LOG (la_handler_context, DLT_LOG_ERROR, DLT_STRING ("Failed to register legacy application: " diff --git a/node-startup-controller/la-handler-service.c b/node-startup-controller/la-handler-service.c index 85769eb..6273bfe 100644 --- a/node-startup-controller/la-handler-service.c +++ b/node-startup-controller/la-handler-service.c @@ -316,7 +316,8 @@ la_handler_service_handle_register (LAHandler *interface, { /* the shutdown mode is invalid */ DLT_LOG (la_handler_context, DLT_LOG_ERROR, - DLT_STRING ("Register called with invalid shutdown mode")); + DLT_STRING ("Failed to register legacy application: " + "invalid shutdown mode"), DLT_INT (shutdown_mode)); la_handler_complete_register (interface, invocation); return TRUE; } -- 2.7.4