Browse Source

core: rpc more verbose when duplicates found

When duplicate rpc names are detected, print them (WARN(..)).
Andrei Pelinescu-Onciul 16 years ago
parent
commit
1f7b7e075d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      rpc_lookup.c

+ 4 - 1
rpc_lookup.c

@@ -27,6 +27,7 @@
 #include "rpc.h"
 #include "str_hash.h"
 #include "ut.h"
+#include "dprint.h"
 
 #define RPC_HASH_SIZE	32
 #define RPC_SARRAY_SIZE	32 /* initial size */
@@ -186,8 +187,10 @@ int rpc_register(rpc_export_t* rpc)
 {
 	
 	/* check if the entry is already registered */
-	if (rpc_lookup(rpc->name, strlen(rpc->name)))
+	if (rpc_lookup(rpc->name, strlen(rpc->name))){
+		WARN("duplicate rpc \"%s\"\n", rpc->name);
 		return 1;
+	}
 	if (rpc_hash_add(rpc)!=0) return -1;
 	return 0;
 }