summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-07 19:12:16 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-03-07 19:12:16 +0100
commit8aabd47c6f4fefc8fbd70c34a738f7c26956d8cd (patch)
treec5f812515e91e8a3ed26d80ea0baa319e4eef99f
parent145b4bdae4e71d8d304623372cf7a1e511bfe3d4 (diff)
proto-shell: defer init until after command line option processing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--main.c2
-rw-r--r--proto-shell.c2
-rw-r--r--proto.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index fb6deed..f70db54 100644
--- a/main.c
+++ b/main.c
@@ -25,6 +25,7 @@
#include "system.h"
#include "interface.h"
#include "wireless.h"
+#include "proto.h"
unsigned int debug_mask = 0;
const char *main_path = DEFAULT_MAIN_PATH;
@@ -326,6 +327,7 @@ int main(int argc, char **argv)
return 1;
}
+ proto_shell_init();
wireless_init();
if (system_init()) {
diff --git a/proto-shell.c b/proto-shell.c
index 37859f4..9041045 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -769,7 +769,7 @@ proto_shell_add_handler(const char *script, const char *name, json_object *obj)
add_proto_handler(proto);
}
-static void __init proto_shell_init(void)
+void proto_shell_init(void)
{
proto_fd = netifd_open_subdir("proto");
if (proto_fd < 0)
diff --git a/proto.h b/proto.h
index 996196b..e402a91 100644
--- a/proto.h
+++ b/proto.h
@@ -73,5 +73,6 @@ unsigned int parse_netmask_string(const char *str, bool v6);
int proto_apply_static_ip_settings(struct interface *iface, struct blob_attr *attr);
int proto_apply_ip_settings(struct interface *iface, struct blob_attr *attr, bool ext);
void proto_dump_handlers(struct blob_buf *b);
+void proto_shell_init(void);
#endif