diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-04-30 14:13:00 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-01 06:08:49 +0200 |
commit | b08159ef475aa8be92cd87504da97321a099e55c (patch) | |
tree | 1d879504d5337656ee977702347b788c0485a014 /src | |
parent | afd366738b6b3bd219d60e87c4f8cdaf24a30969 (diff) | |
download | connman-b08159ef475aa8be92cd87504da97321a099e55c.tar.gz connman-b08159ef475aa8be92cd87504da97321a099e55c.tar.bz2 connman-b08159ef475aa8be92cd87504da97321a099e55c.zip |
clock: Use helper function to add timeservers only once
Diffstat (limited to 'src')
-rw-r--r-- | src/clock.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/clock.c b/src/clock.c index f92a3be4..a742557d 100644 --- a/src/clock.c +++ b/src/clock.c @@ -271,11 +271,15 @@ static DBusMessage *set_property(DBusConnection *conn, while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) { const char *val; + GSList *new_head; dbus_message_iter_get_basic(&entry, &val); - list = g_slist_prepend(list, strdup(val)); - count++; + new_head = __connman_timeserver_add_list(list, val); + if (list != new_head) { + count++; + list = new_head; + } dbus_message_iter_next(&entry); } |