summaryrefslogtreecommitdiff
path: root/accel-pppd/cli
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2011-05-30 11:24:27 +0400
committerKozlov Dmitry <dima@server>2011-05-30 11:24:27 +0400
commit276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa (patch)
treef50c4e781ba13c3ee59382a4466cfafa31ef464a /accel-pppd/cli
parent01afc34e830f2adf94c191a3c4f2761888dae53b (diff)
downloadaccel-ppp-276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa.tar.gz
accel-ppp-276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa.zip
rewrited initialization procedure (fix gcc-4.6 builds)
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r--accel-pppd/cli/cli.c4
-rw-r--r--accel-pppd/cli/show_sessions.c3
-rw-r--r--accel-pppd/cli/std_cmd.c3
-rw-r--r--accel-pppd/cli/tcp.c3
-rw-r--r--accel-pppd/cli/telnet.c3
5 files changed, 11 insertions, 5 deletions
diff --git a/accel-pppd/cli/cli.c b/accel-pppd/cli/cli.c
index 5009a742..00d5ffbe 100644
--- a/accel-pppd/cli/cli.c
+++ b/accel-pppd/cli/cli.c
@@ -219,9 +219,11 @@ static void load_config(void)
conf_cli_prompt = (char *)def_cli_prompt;
}
-static void __init init(void)
+static void init(void)
{
load_config();
triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config);
}
+
+DEFINE_INIT(10, init);
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c
index 555fa885..3fb3f0aa 100644
--- a/accel-pppd/cli/show_sessions.c
+++ b/accel-pppd/cli/show_sessions.c
@@ -417,7 +417,7 @@ static void print_sid(const struct ppp_t *ppp, char *buf)
snprintf(buf, CELL_SIZE, "%s", ppp->sessionid);
}
-void __init init(void)
+static void init(void)
{
cli_register_simple_cmd2(show_ses_exec, show_ses_help, 2, "show", "sessions");
@@ -432,3 +432,4 @@ void __init init(void)
cli_show_ses_register("sid", "session id", print_sid);
}
+DEFINE_INIT(12, init);
diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c
index 0754b19c..e24b3fa0 100644
--- a/accel-pppd/cli/std_cmd.c
+++ b/accel-pppd/cli/std_cmd.c
@@ -326,7 +326,7 @@ static void reload_help(char * const *fields, int fields_cnt, void *client)
cli_send(client, "reload - reload config file\r\n");
}
-static void __init init(void)
+static void init(void)
{
cli_register_simple_cmd2(show_stat_exec, show_stat_help, 2, "show", "stat");
cli_register_simple_cmd2(terminate_exec, terminate_help, 1, "terminate");
@@ -335,3 +335,4 @@ static void __init init(void)
cli_register_simple_cmd2(exit_exec, exit_help, 1, "exit");
}
+DEFINE_INIT(12, init);
diff --git a/accel-pppd/cli/tcp.c b/accel-pppd/cli/tcp.c
index 260225f1..fea0e4eb 100644
--- a/accel-pppd/cli/tcp.c
+++ b/accel-pppd/cli/tcp.c
@@ -339,7 +339,7 @@ static void start_server(const char *host, int port)
triton_context_wakeup(&serv_ctx);
}
-static void __init init(void)
+static void init(void)
{
const char *opt;
char *host, *d;
@@ -369,3 +369,4 @@ err_fmt:
free(host);
}
+DEFINE_INIT(11, init);
diff --git a/accel-pppd/cli/telnet.c b/accel-pppd/cli/telnet.c
index 82bcb0d4..26436923 100644
--- a/accel-pppd/cli/telnet.c
+++ b/accel-pppd/cli/telnet.c
@@ -718,7 +718,7 @@ static void load_history_file(void)
fclose(f);
}
-static void __init init(void)
+static void init(void)
{
const char *opt;
char *host, *d;
@@ -757,3 +757,4 @@ err_fmt:
free(host);
}
+DEFINE_INIT(11, init);