Browse code

core: rpc more verbose when duplicates found

When duplicate rpc names are detected, print them (WARN(..)).

Andrei Pelinescu-Onciul authored on 15/07/2009 20:49:23
Showing 1 changed files
... ...
@@ -27,6 +27,7 @@
27 27
 #include "rpc.h"
28 28
 #include "str_hash.h"
29 29
 #include "ut.h"
30
+#include "dprint.h"
30 31
 
31 32
 #define RPC_HASH_SIZE	32
32 33
 #define RPC_SARRAY_SIZE	32 /* initial size */
... ...
@@ -186,8 +187,10 @@ int rpc_register(rpc_export_t* rpc)
186 186
 {
187 187
 	
188 188
 	/* check if the entry is already registered */
189
-	if (rpc_lookup(rpc->name, strlen(rpc->name)))
189
+	if (rpc_lookup(rpc->name, strlen(rpc->name))){
190
+		WARN("duplicate rpc \"%s\"\n", rpc->name);
190 191
 		return 1;
192
+	}
191 193
 	if (rpc_hash_add(rpc)!=0) return -1;
192 194
 	return 0;
193 195
 }