diff options
| author | Michael Biebl <biebl@debian.org> | 2011-08-23 19:16:47 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-08-23 19:16:47 +0200 |
| commit | 263bf4c0c89bb88dc995acd9a6a2de9095fbd461 (patch) | |
| tree | 7224326afe367409e7150e49fad9029f81fe24b8 /cli | |
| parent | d465e5fac63f36bcf4069e36827f4b62c494556d (diff) | |
Imported Upstream version 0.9.0 upstream/0.9.0
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/src/Makefile.am | 2 | ||||
| -rw-r--r-- | cli/src/Makefile.in | 3 | ||||
| -rw-r--r-- | cli/src/connections.c | 24 |
3 files changed, 7 insertions, 22 deletions
diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am index 572e122f..f49d0127 100644 --- a/cli/src/Makefile.am +++ b/cli/src/Makefile.am @@ -4,7 +4,6 @@ bin_PROGRAMS = \ INCLUDES = \ -I${top_srcdir} \ -I${top_srcdir}/include \ - -I${top_builddir}/marshallers \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-glib @@ -31,7 +30,6 @@ nmcli_CPPFLAGS = \ nmcli_LDADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ - $(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-glib/libnm-glib.la diff --git a/cli/src/Makefile.in b/cli/src/Makefile.in index e4708ad1..33aa3f2b 100644 --- a/cli/src/Makefile.in +++ b/cli/src/Makefile.in @@ -63,7 +63,6 @@ am_nmcli_OBJECTS = nmcli-connections.$(OBJEXT) nmcli-devices.$(OBJEXT) \ nmcli_OBJECTS = $(am_nmcli_OBJECTS) am__DEPENDENCIES_1 = nmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-glib/libnm-glib.la AM_V_lt = $(am__v_lt_$(V)) @@ -309,7 +308,6 @@ top_srcdir = @top_srcdir@ INCLUDES = \ -I${top_srcdir} \ -I${top_srcdir}/include \ - -I${top_builddir}/marshallers \ -I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-glib @@ -336,7 +334,6 @@ nmcli_CPPFLAGS = \ nmcli_LDADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ - $(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-glib/libnm-glib.la diff --git a/cli/src/connections.c b/cli/src/connections.c index 2646aa9e..5febc58a 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -400,6 +400,7 @@ show_connection (NMConnection *data, gpointer user_data) NmCli *nmc = (NmCli *) user_data; NMSettingConnection *s_con; guint64 timestamp; + time_t timestamp_real; char *timestamp_str; char timestamp_real_str[64]; @@ -408,7 +409,8 @@ show_connection (NMConnection *data, gpointer user_data) /* Obtain field values */ timestamp = nm_setting_connection_get_timestamp (s_con); timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); - strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); + timestamp_real = timestamp; + strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime (×tamp_real)); nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); @@ -1075,22 +1077,10 @@ find_device_for_connection (NmCli *nmc, /* VPN connections */ NMActiveConnection *active = NULL; if (iface) { - const GPtrArray *connections = nm_client_get_active_connections (nmc->client); - for (i = 0; connections && (i < connections->len) && !active; i++) { - NMActiveConnection *candidate = g_ptr_array_index (connections, i); - const GPtrArray *devices = nm_active_connection_get_devices (candidate); - if (!devices || !devices->len) - continue; - - for (j = 0; devices && (j < devices->len); j++) { - NMDevice *dev = g_ptr_array_index (devices, j); - if (!strcmp (iface, nm_device_get_iface (dev))) { - active = candidate; - *device = dev; - break; - } - } - } + *device = nm_client_get_device_by_iface (nmc->client, iface); + if (*device) + active = nm_device_get_active_connection (*device); + if (!active) { g_set_error (error, 0, 0, _("no active connection on device '%s'"), iface); return FALSE; |