From bc82f6f6906fb7572cf7745b6c59678efc2094e2 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 14 Jul 2015 12:57:26 +0200 Subject: [PATCH] vpn-plugin-old,dispatcher: cast unchecked g_variant_lookup() calls to void This is done to silence coverity. In the dispatcher the existence of the key is checked before and we're fine with leaving the value untouched in the vpn-plugin-old. (cherry picked from commit a9996c4f1d5adeb54827f925c5595858fcd9a7e1) --- callouts/nm-dispatcher-utils.c | 2 +- libnm/nm-vpn-plugin-old.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/callouts/nm-dispatcher-utils.c b/callouts/nm-dispatcher-utils.c index d8a8e8d87c..e7a6f6a2e6 100644 --- a/callouts/nm-dispatcher-utils.c +++ b/callouts/nm-dispatcher-utils.c @@ -377,7 +377,7 @@ nm_dispatcher_utils_construct_envp (const char *action, return NULL; } g_variant_unref (value); - g_variant_lookup (device_props, NMD_DEVICE_PROPS_IP_INTERFACE, "&s", &ip_iface); + (void) g_variant_lookup (device_props, NMD_DEVICE_PROPS_IP_INTERFACE, "&s", &ip_iface); } /* Device type */ diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c index e6843f7e18..b43c481c7f 100644 --- a/libnm/nm-vpn-plugin-old.c +++ b/libnm/nm-vpn-plugin-old.c @@ -279,8 +279,8 @@ nm_vpn_plugin_old_set_config (NMVpnPluginOld *plugin, priv->got_config = TRUE; - g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_HAS_IP4, "b", &priv->has_ip4); - g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_HAS_IP6, "b", &priv->has_ip6); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_HAS_IP4, "b", &priv->has_ip4); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_HAS_IP6, "b", &priv->has_ip6); g_warn_if_fail (priv->has_ip4 || priv->has_ip6); @@ -288,13 +288,13 @@ nm_vpn_plugin_old_set_config (NMVpnPluginOld *plugin, * ip4config, for compatibility with older daemons. */ g_clear_pointer (&priv->banner, g_free); - g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_BANNER, "&s", &priv->banner); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_BANNER, "&s", &priv->banner); g_clear_pointer (&priv->tundev, g_free); - g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_TUNDEV, "&s", &priv->tundev); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_TUNDEV, "&s", &priv->tundev); g_clear_pointer (&priv->gateway, g_free); - g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "&s", &priv->gateway); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "&s", &priv->gateway); g_clear_pointer (&priv->mtu, g_free); - g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_MTU, "&s", &priv->mtu); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_MTU, "&s", &priv->mtu); g_signal_emit (plugin, signals[CONFIG], 0, config); }