about summary refs log tree commit diff
path: root/examples/C
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2020-07-02 12:20:27 +0200
committerSebastien Bacher <seb128@ubuntu.com>2020-07-02 12:20:27 +0200
commit486e0bef719d78ee55d2166b0bfb4fa684c09854 (patch)
treeaead4c1cc30eb61a2d9dec70f7c8339904506fad /examples/C
parent39143df7aed46e83f8c68ea9ad6d24cfdf5a1dd8 (diff)
parent10ae7d8cd706062742d0cdb1803d49909aef9e06 (diff)
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'examples/C')
-rw-r--r--examples/C/glib/list-connections-libnm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/C/glib/list-connections-libnm.c b/examples/C/glib/list-connections-libnm.c
index 77d5dfb7..7bed0c01 100644
--- a/examples/C/glib/list-connections-libnm.c
+++ b/examples/C/glib/list-connections-libnm.c
@@ -30,10 +30,15 @@ show_connection (NMConnection *connection)
 
 	s_con = nm_connection_get_setting_connection (connection);
 	if (s_con) {
+		struct tm localtime_data;
+
 		/* Get various info from NMSettingConnection and show it */
 		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 *) &timestamp));
+		strftime (timestamp_real_str,
+		          sizeof (timestamp_real_str),
+		          "%c",
+		          localtime_r ((time_t *) &timestamp, &localtime_data));
 
 		val1 = nm_setting_connection_get_id (s_con);
 		val2 = nm_setting_connection_get_uuid (s_con);