[hipl-commit] [tiny] Rev 3608: Fixed bug regarding maintenance functions.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Wed, 3 Mar 2010 17:25:42 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Wed Mar 03 16:24:05 2010 +0100
Revision: 3608
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Fixed bug regarding maintenance functions.
  
  The registration of maintenance functions was not functioning.
  
  Added debug output.

Modified:
  M  hipd/modularization.c

=== modified file 'hipd/modularization.c'
--- hipd/modularization.c       2010-03-03 14:56:11 +0000
+++ hipd/modularization.c       2010-03-03 15:24:05 +0000
@@ -86,6 +86,10 @@
             lmod_register_function(hip_handle_functions[packet_type][ha_state],
                                    new_entry,
                                    priority);
+    if (hip_handle_functions[packet_type][ha_state] == NULL) {
+        HIP_ERROR("Error on registering a handle function.\n");
+        err = -1;
+    }
 out_err:
     return err;
 }
@@ -208,11 +212,13 @@
     new_entry->priority    = priority;
     new_entry->func_ptr    = maint_function;
 
-    HIP_IFEL(lmod_register_function(hip_maintenance_functions,
-                                    new_entry,
-                                    priority),
-             -1,
-             "Error on registering a maintenance function.\n");
+    hip_maintenance_functions = 
lmod_register_function(hip_maintenance_functions,
+                                                       new_entry,
+                                                       priority);
+    if (hip_maintenance_functions == NULL) {
+        HIP_ERROR("Error on registering a maintenance function.\n");
+        err = -1;
+    }
 
 out_err:
     return err;
@@ -235,6 +241,8 @@
         while ((iter = hip_ll_iterate(hip_maintenance_functions, iter)) != 
NULL) {
             ((struct maint_function*) iter->ptr)->func_ptr();
         }
+    } else {
+        HIP_DEBUG("No maintenance function registered.\n");
     }
 
     return err;

Other related posts:

  • » [hipl-commit] [tiny] Rev 3608: Fixed bug regarding maintenance functions. - Tim Just