When duplicate rpc names are detected, print them (WARN(..)).
... | ... |
@@ -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 | 187 |
{ |
187 | 188 |
|
188 | 189 |
/* check if the entry is already registered */ |
189 |
- if (rpc_lookup(rpc->name, strlen(rpc->name))) |
|
190 |
+ if (rpc_lookup(rpc->name, strlen(rpc->name))){ |
|
191 |
+ WARN("duplicate rpc \"%s\"\n", rpc->name); |
|
190 | 192 |
return 1; |
193 |
+ } |
|
191 | 194 |
if (rpc_hash_add(rpc)!=0) return -1; |
192 | 195 |
return 0; |
193 | 196 |
} |