summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-06-01 02:16:35 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-06-01 02:19:24 +0200
commit279273b09a7bd2f81bf8f29fdf5fd92e8899f014 (patch)
treedc66144548ae96bc819a075c4256b2a313a1755a
parent40ee49bad468402fa7242801979a392152a039c6 (diff)
downloadconnman-279273b09a7bd2f81bf8f29fdf5fd92e8899f014.tar.gz
connman-279273b09a7bd2f81bf8f29fdf5fd92e8899f014.tar.bz2
connman-279273b09a7bd2f81bf8f29fdf5fd92e8899f014.zip
Remove default ntpd server
Default ntpd servers should be defined by plugins. Now the MeeGo one sets a default server instead of hardcoding it from the ntpd plugin.
-rw-r--r--plugins/meego.c6
-rw-r--r--plugins/ntpd.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/meego.c b/plugins/meego.c
index 49978fa9..717b2205 100644
--- a/plugins/meego.c
+++ b/plugins/meego.c
@@ -24,15 +24,19 @@
#endif
#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/timeserver.h>
#include <connman/plugin.h>
+#define MEEGO_NTP_SERVER "ntp.meego.com"
+
static int meego_init(void)
{
- return 0;
+ return connman_timeserver_append(MEEGO_NTP_SERVER);
}
static void meego_exit(void)
{
+ connman_timeserver_remove(MEEGO_NTP_SERVER);
}
CONNMAN_PLUGIN_DEFINE(meego, "MeeGo features plugin", VERSION,
diff --git a/plugins/ntpd.c b/plugins/ntpd.c
index 2ab30721..fa74ea85 100644
--- a/plugins/ntpd.c
+++ b/plugins/ntpd.c
@@ -45,7 +45,6 @@ static GList *peers = NULL;
static GList *pending_peers = NULL;
#define NTPD_PORT 123
-#define DEFAULT_NTP_PEER "ntp.meego.com"
struct ntpd_peer {
char *server;
@@ -174,9 +173,6 @@ static int ntpdate(void)
DBG("conf path %s", ntpdate->conf_path);
- if (pending_peers == NULL && peers == NULL)
- ntpdate_add_peer(ntpdate, DEFAULT_NTP_PEER);
-
for (list = pending_peers; list; list = list->next) {
peer = list->data;
@@ -216,6 +212,10 @@ static void ntpd_sync(void)
DBG("");
+ if (g_list_length(pending_peers) == 0 &&
+ g_list_length(peers) == 0)
+ return;
+
if (!ntpd_running()) {
ntpdate();
return;