From: Patrik Flykt Date: Mon, 30 Apr 2012 11:13:01 +0000 (+0300) Subject: service: Use helper function to add timeservers only once X-Git-Tag: 0.85~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a25e63665687d881b3cb7d97bea07533284764b8;p=platform%2Fupstream%2Fconnman.git service: Use helper function to add timeservers only once --- diff --git a/src/service.c b/src/service.c index a6bd606..018f12f 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); }