From: Felix Fietkau Date: Fri, 7 Mar 2014 18:12:16 +0000 (+0100) Subject: proto-shell: defer init until after command line option processing X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8aabd47c6f4fefc8fbd70c34a738f7c26956d8cd;p=oweals%2Fnetifd.git proto-shell: defer init until after command line option processing Signed-off-by: Felix Fietkau --- 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