Make shutdown mode registration similar in NSC and helper binary
authorJonathan Maw <jonathan.maw@codethink.co.uk>
Fri, 3 Aug 2012 13:31:57 +0000 (14:31 +0100)
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Fri, 3 Aug 2012 13:43:11 +0000 (14:43 +0100)
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
node-startup-controller/la-handler-service.c

index 66d7f3e..b020df9 100644 (file)
@@ -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: "
index 85769eb..6273bfe 100644 (file)
@@ -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;
     }