diff options
| author | Michael Biebl <biebl@debian.org> | 2018-09-08 17:44:52 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-09-08 17:44:52 +0200 |
| commit | d8cad4490d54acb162ad218a8a682ab379bb8bcc (patch) | |
| tree | 140abd545d62a1b0144be27c93ad8edb021e4311 /src/tests/test-wired-defname.c | |
| parent | e3bc109cd0eb97346c448f591af518d85dbee21b (diff) | |
| parent | 8f7a3cbbdd0c0a48277c341dd3a8ec8743ae9735 (diff) | |
Update upstream source from tag 'upstream/1.13.90'
Update to upstream version '1.13.90' with Debian dir d7d3d98e1240df49343a72511602da7099232e10
Diffstat (limited to 'src/tests/test-wired-defname.c')
| -rw-r--r-- | src/tests/test-wired-defname.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/tests/test-wired-defname.c b/src/tests/test-wired-defname.c index a966ed21..97a6c319 100644 --- a/src/tests/test-wired-defname.c +++ b/src/tests/test-wired-defname.c @@ -44,15 +44,14 @@ _new_connection (const char *id) static char * _get_default_wired_name (GSList *list) { - gs_free NMConnection **v = NULL; - guint l, i; - - l = g_slist_length (list); - v = g_new0 (NMConnection *, l + 1); - for (i = 0; list; list = list->next, i++) - v[i] = NM_CONNECTION (list->data); - g_assert (i == l); - return nm_device_ethernet_utils_get_default_wired_name (v); + gs_unref_hashtable GHashTable *existing_ids = NULL; + + if (list) { + existing_ids = g_hash_table_new (nm_str_hash, g_str_equal); + for (; list; list = list->next) + g_hash_table_add (existing_ids, (char *) nm_connection_get_id (list->data)); + } + return nm_device_ethernet_utils_get_default_wired_name (existing_ids); } /*****************************************************************************/ |