From f40d50249247dda6e1eb7b89f0ec51405d00d3a8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 27 Mar 2009 11:53:46 -0400 Subject: [PATCH] ifcfg-rh: don't write LAST_CONNECT if it's 0 --- system-settings/plugins/ifcfg-rh/writer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c index a2c43b97cd..6316b52af3 100644 --- a/system-settings/plugins/ifcfg-rh/writer.c +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -525,9 +525,13 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg) svSetValue (ifcfg, "ONBOOT", nm_setting_connection_get_autoconnect (s_con) ? "yes" : "no", FALSE); - tmp = g_strdup_printf ("%llu", nm_setting_connection_get_timestamp (s_con)); - svSetValue (ifcfg, "LAST_CONNECT", tmp, FALSE); - g_free (tmp); + + svSetValue (ifcfg, "LAST_CONNECT", NULL, FALSE); + if (nm_setting_connection_get_timestamp (s_con)) { + tmp = g_strdup_printf ("%llu", nm_setting_connection_get_timestamp (s_con)); + svSetValue (ifcfg, "LAST_CONNECT", tmp, FALSE); + g_free (tmp); + } } static gboolean