summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2012-08-03 14:31:57 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-03 14:43:11 +0100
commit18d7b4c8b4b4eba3eb645da6e062b76efdf01b12 (patch)
tree9e50a676d9212f8e0e3256a3db1181ab00c52c96
parent91704f12f85626efd7ffad0b05c83befbd72ef4d (diff)
downloadnode-startup-controller-18d7b4c8b4b4eba3eb645da6e062b76efdf01b12.tar.gz
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
-rw-r--r--legacy-app-handler/main.c6
-rw-r--r--node-startup-controller/la-handler-service.c3
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;
}