summaryrefslogtreecommitdiff
path: root/accel-pppd/extra
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/extra
parent01afc34e830f2adf94c191a3c4f2761888dae53b (diff)
downloadaccel-ppp-276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa.tar.gz
accel-ppp-276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa.zip
rewrited initialization procedure (fix gcc-4.6 builds)
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r--accel-pppd/extra/chap-secrets.c3
-rw-r--r--accel-pppd/extra/ippool.c4
-rw-r--r--accel-pppd/extra/pppd_compat.c4
-rw-r--r--accel-pppd/extra/shaper_tbf.c3
-rw-r--r--accel-pppd/extra/sigchld.c4
5 files changed, 13 insertions, 5 deletions
diff --git a/accel-pppd/extra/chap-secrets.c b/accel-pppd/extra/chap-secrets.c
index a42ab23..ee83bce 100644
--- a/accel-pppd/extra/chap-secrets.c
+++ b/accel-pppd/extra/chap-secrets.c
@@ -268,7 +268,7 @@ static void load_config(void)
conf_gw_ip_address = inet_addr(opt);
}
-static void __init init(void)
+static void init(void)
{
load_config();
@@ -280,3 +280,4 @@ static void __init init(void)
triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config);
}
+DEFINE_INIT(100, init);
diff --git a/accel-pppd/extra/ippool.c b/accel-pppd/extra/ippool.c
index 20da17c..b5711d0 100644
--- a/accel-pppd/extra/ippool.c
+++ b/accel-pppd/extra/ippool.c
@@ -182,7 +182,7 @@ static struct ipdb_t ipdb = {
.put = put_ip,
};
-static void __init ipool_init(void)
+static void ippool_init(void)
{
struct conf_sect_t *s = conf_get_section("ip-pool");
struct conf_option_t *opt;
@@ -206,3 +206,5 @@ static void __init ipool_init(void)
ipdb_register(&ipdb);
}
+DEFINE_INIT(100, ippool_init);
+
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 5fa9beb..aa6f6b5 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -497,7 +497,7 @@ static void fill_env(char **env, struct pppd_compat_pd_t *pd)
}
}
-static void __init init(void)
+static void init(void)
{
char *opt;
@@ -537,3 +537,5 @@ static void __init init(void)
}
#endif
}
+
+DEFINE_INIT(101, init);
diff --git a/accel-pppd/extra/shaper_tbf.c b/accel-pppd/extra/shaper_tbf.c
index c276869..997b0e9 100644
--- a/accel-pppd/extra/shaper_tbf.c
+++ b/accel-pppd/extra/shaper_tbf.c
@@ -1256,7 +1256,7 @@ static int clock_init(void)
return 0;
}
-static void __init init(void)
+static void init(void)
{
if (clock_init())
return;
@@ -1281,3 +1281,4 @@ static void __init init(void)
cli_show_ses_register("rate-limit", "rate limit down-stream/up-stream (Kbit)", print_rate);
}
+DEFINE_INIT(100, init);
diff --git a/accel-pppd/extra/sigchld.c b/accel-pppd/extra/sigchld.c
index 08bab93..8f1a979 100644
--- a/accel-pppd/extra/sigchld.c
+++ b/accel-pppd/extra/sigchld.c
@@ -109,8 +109,10 @@ void __export sigchld_unlock()
pthread_mutex_unlock(&handlers_lock);
}
-static void __init init(void)
+static void init(void)
{
if (pthread_create(&sigchld_thr, NULL, sigchld_thread, NULL))
log_emerg("sigchld: pthread_create: %s\n", strerror(errno));
}
+
+DEFINE_INIT(100, init); \ No newline at end of file