Sfoglia il codice sorgente

The header file ds_rpc.h statically defines the doc string for some RPC
functions, and is included in source ds_rpc.c file that does not use the
defines - they are used in dispatcher.c only; this leads, of course, to
compiler whining about it.
The applied patch fixes that.

Closes #SER-418.

Bogdan Pintea 16 anni fa
parent
commit
4486239b37

+ 0 - 6
modules_s/dispatcher/dispatcher.c

@@ -68,12 +68,6 @@ static cmd_export_t cmds[]={
 	{0,0,0,0,0}
 };
 
-static rpc_export_t rpc_methods[] = {
-    {"dispatcher.dump",     rpc_dump,       rpc_dump_doc,       0},
-    {"dispatcher.reload",   rpc_reload,     rpc_reload_doc,     0},
-    {0, 0, 0, 0}
-};
-
 static param_export_t params[]={
 	{"list_file",      PARAM_STRING, &dslistfile},
 	{"force_dst",      PARAM_INT,    &force_dst},

+ 17 - 0
modules_s/dispatcher/ds_rpc.c

@@ -112,3 +112,20 @@ void rpc_reload(rpc_t *rpc, void *c) {
     }
 	return ;
 }
+
+/* rpc function titles */
+static const char *rpc_dump_doc[2] = {
+	"Dump dispatcher set configuration",
+	0
+};
+static const char *rpc_reload_doc[2] = {
+	"Reload dispatcher list from file",
+	0
+};
+
+rpc_export_t rpc_methods[] = {
+    {"dispatcher.dump",     rpc_dump,       rpc_dump_doc,       0},
+    {"dispatcher.reload",   rpc_reload,     rpc_reload_doc,     0},
+    {0, 0, 0, 0}
+};
+

+ 2 - 15
modules_s/dispatcher/ds_rpc.h

@@ -31,21 +31,8 @@
 #ifndef _DS_RPC_H_
 #define _DS_RPC_H_
 
-#include "../../sr_module.h"
-#include "dispatcher.h"
+#include "../../rpc.h"
 
-/* rpc function titles */
-static const char *rpc_dump_doc[2] = {
-	"Dump dispatcher set configuration",
-	0
-};
-static const char *rpc_reload_doc[2] = {
-	"Reload dispatcher list from file",
-	0
-};
-
-/* prototypes */
-void rpc_dump(rpc_t *rpc, void *c);
-void rpc_reload(rpc_t *rpc, void *c);
+extern rpc_export_t rpc_methods[];
 
 #endif /* _DS_RPC_H_ */