/[gentoo-x86]/net-misc/networkmanager/files/networkmanager-0.8.2-ifnet-smarter-write.patch
Gentoo

Contents of /net-misc/networkmanager/files/networkmanager-0.8.2-ifnet-smarter-write.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Feb 25 09:54:42 2011 UTC (7 years, 2 months ago) by qiaomuf
Branch: MAIN
Won't write to /etc/conf.d/net when nothing changed

(Portage version: 2.1.9.41/cvs/Linux x86_64)

1 From ad30f01d6108a7e8e05e5e90c93b2a750b7be240 Mon Sep 17 00:00:00 2001
2 From: Mu Qiao <qiaomuf@gentoo.org>
3 Date: Fri, 25 Feb 2011 16:25:07 +0000
4 Subject: [PATCH 3/3] Won't write when nothing changed
5 Signed-off-by: Mu Qiao <qiaomuf@gentoo.org>
6
7 ---
8 system-settings/plugins/ifnet/net_parser.c | 14 ++++++++++----
9 system-settings/plugins/ifnet/wpa_parser.c | 3 ++-
10 2 files changed, 12 insertions(+), 5 deletions(-)
11
12 diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c
13 index de2db8a..e01b092 100644
14 --- a/system-settings/plugins/ifnet/net_parser.c
15 +++ b/system-settings/plugins/ifnet/net_parser.c
16 @@ -413,10 +413,16 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value)
17 if (g_hash_table_lookup_extended (conn, key, &orin_key, &orin_value)) {
18 if (new_value && !strcmp (orin_value, new_value))
19 return;
20 - g_hash_table_remove (conn, orin_key);
21 - g_free (orin_key);
22 - g_free (orin_value);
23 - }
24 + /* Won't remove dns_servers wrt bug #356339 */
25 + if (strcmp (orin_key, "dns_servers")){
26 + g_hash_table_remove (conn, orin_key);
27 + g_free (orin_key);
28 + g_free (orin_value);
29 + } else
30 + return;
31 + /* old key/value doesn't exist but new value is NULL */
32 + } else if (!value)
33 + return;
34 if (new_value)
35 g_hash_table_insert (conn, g_strdup (key), new_value);
36 net_parser_data_changed = TRUE;
37 diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c
38 index 42c52c3..2c3869e 100644
39 --- a/system-settings/plugins/ifnet/wpa_parser.c
40 +++ b/system-settings/plugins/ifnet/wpa_parser.c
41 @@ -468,7 +468,8 @@ wpa_set_data (gchar * ssid, gchar * key, gchar * value)
42 g_hash_table_remove (security, orig_key);
43 g_free (orig_key);
44 g_free (orig_value);
45 - }
46 + } else if (!value)
47 + return;
48
49 /* Add new key value */
50 if (new_value)
51 --
52 1.7.3.4
53

  ViewVC Help
Powered by ViewVC 1.1.20