[hipl-commit] [tiny] Rev 3650: Added error checking to module registration.

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

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Wed Mar 10 16:06:40 2010 +0100
Revision: 3650
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Added error checking to module registration.

Modified:
  M  modules/heartbeat/hipd/heartbeat.c
  M  modules/update/hipd/update.c

=== modified file 'modules/heartbeat/hipd/heartbeat.c'
--- modules/heartbeat/hipd/heartbeat.c  2010-03-09 17:39:10 +0000
+++ modules/heartbeat/hipd/heartbeat.c  2010-03-10 15:06:40 +0000
@@ -195,7 +195,9 @@
     struct icmp6_filter filter;
     int *icmpsockfd = &hip_icmp_sock;
 
-    lmod_add_module_id("heartbeat");
+    HIP_IFEL(lmod_add_module_id("heartbeat"),
+             -1,
+             "Error on registering HEATBEAT module.\n");
 
     hip_register_maint_function(&hip_heartbeat_maintenance, 10000);
     hip_register_socket(hip_icmp_sock, NULL, 30000);

=== modified file 'modules/update/hipd/update.c'
--- modules/update/hipd/update.c        2010-03-09 17:37:47 +0000
+++ modules/update/hipd/update.c        2010-03-10 15:06:40 +0000
@@ -873,11 +873,16 @@
 /**
  * Initialization function for update module.
  *
- * @return 0
+ * @return Success =  0
+ *         Error   = -1
  */
 int hip_update_init(void)
 {
-    lmod_add_module_id("update");
+    int err = 0;
+
+    HIP_IFEL(lmod_add_module_id("update"),
+             -1,
+             "Error on registering UPDATE module.\n");
 
     lmod_register_state_init_function(&hip_update_init_state);
 
@@ -892,7 +897,8 @@
 
     hip_register_maint_function(&hip_update_maintenance, 0);
 
-    return 0;
+out_err:
+    return err;
 }
 
 /**

Other related posts:

  • » [hipl-commit] [tiny] Rev 3650: Added error checking to module registration. - Tim Just