diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-04-30 14:13:01 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-01 06:08:49 +0200 |
commit | a25e63665687d881b3cb7d97bea07533284764b8 (patch) | |
tree | 70cbaaca6a9c1848fb3246a75f30ab73c4601172 /src/service.c | |
parent | b08159ef475aa8be92cd87504da97321a099e55c (diff) | |
download | connman-a25e63665687d881b3cb7d97bea07533284764b8.tar.gz connman-a25e63665687d881b3cb7d97bea07533284764b8.tar.bz2 connman-a25e63665687d881b3cb7d97bea07533284764b8.zip |
service: Use helper function to add timeservers only once
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/service.c b/src/service.c index a6bd606c..018f12fc 100644 --- a/src/service.c +++ b/src/service.c @@ -2968,10 +2968,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); } |