dns/resolved: adjust coding style
This commit is contained in:
@@ -1609,10 +1609,11 @@ _resolvconf_resolved_managed (void)
|
||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||
NULL, NULL);
|
||||
|
||||
if (info && g_file_info_get_is_symlink (info))
|
||||
if (info && g_file_info_get_is_symlink (info)) {
|
||||
ret = _nm_utils_strv_find_first ((gchar **) resolved_paths,
|
||||
G_N_ELEMENTS (resolved_paths),
|
||||
g_file_info_get_symlink_target (info)) >= 0;
|
||||
}
|
||||
|
||||
g_clear_object(&info);
|
||||
g_clear_object(&f);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "nm-default.h"
|
||||
|
||||
#include "nm-dns-systemd-resolved.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -139,7 +140,8 @@ static void
|
||||
update_add_ip6_config (NMDnsSystemdResolved *self,
|
||||
GVariantBuilder *dns,
|
||||
GVariantBuilder *domains,
|
||||
const NMIP6Config *config) {
|
||||
const NMIP6Config *config)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0 ; i < nm_ip6_config_get_num_nameservers (config); i++) {
|
||||
@@ -155,7 +157,7 @@ update_add_ip6_config (NMDnsSystemdResolved *self,
|
||||
|
||||
for (i = 0; i < nm_ip6_config_get_num_searches (config); i++) {
|
||||
g_variant_builder_add (domains, "(sb)",
|
||||
nm_ip6_config_get_search(config, i),
|
||||
nm_ip6_config_get_search (config, i),
|
||||
FALSE);
|
||||
}
|
||||
|
||||
@@ -170,7 +172,8 @@ static void
|
||||
update_add_ip4_config (NMDnsSystemdResolved *self,
|
||||
GVariantBuilder *dns,
|
||||
GVariantBuilder *domains,
|
||||
const NMIP4Config *config) {
|
||||
const NMIP4Config *config)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0 ; i < nm_ip4_config_get_num_nameservers (config); i++) {
|
||||
@@ -203,10 +206,10 @@ free_pending_updates (NMDnsSystemdResolved *self)
|
||||
NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
|
||||
GVariant *v;
|
||||
|
||||
while ((v = g_queue_pop_head(&priv->dns_updates)) != NULL)
|
||||
while ((v = g_queue_pop_head (&priv->dns_updates)) != NULL)
|
||||
g_variant_unref (v);
|
||||
|
||||
while ((v = g_queue_pop_head(&priv->domain_updates)) != NULL)
|
||||
while ((v = g_queue_pop_head (&priv->domain_updates)) != NULL)
|
||||
g_variant_unref (v);
|
||||
}
|
||||
|
||||
@@ -237,9 +240,9 @@ prepare_one_interface (NMDnsSystemdResolved *self, InterfaceConfig *ic)
|
||||
g_variant_builder_close (&domains);
|
||||
|
||||
g_queue_push_tail (&priv->dns_updates,
|
||||
g_variant_ref_sink(g_variant_builder_end (&dns)));
|
||||
g_variant_ref_sink (g_variant_builder_end (&dns)));
|
||||
g_queue_push_tail (&priv->domain_updates,
|
||||
g_variant_ref_sink(g_variant_builder_end (&domains)));
|
||||
g_variant_ref_sink (g_variant_builder_end (&domains)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -251,14 +254,14 @@ send_updates (NMDnsSystemdResolved *self)
|
||||
if (!priv->resolve)
|
||||
return;
|
||||
|
||||
while ((v = g_queue_pop_head(&priv->dns_updates)) != NULL) {
|
||||
while ((v = g_queue_pop_head (&priv->dns_updates)) != NULL) {
|
||||
g_dbus_proxy_call (priv->resolve, "SetLinkDNS", v,
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1, priv->update_cancellable, call_done, self);
|
||||
g_variant_unref (v);
|
||||
}
|
||||
|
||||
while ((v = g_queue_pop_head(&priv->domain_updates)) != NULL) {
|
||||
while ((v = g_queue_pop_head (&priv->domain_updates)) != NULL) {
|
||||
g_dbus_proxy_call (priv->resolve, "SetLinkDomains", v,
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1, priv->update_cancellable, call_done, self);
|
||||
@@ -274,7 +277,7 @@ update (NMDnsPlugin *plugin,
|
||||
{
|
||||
NMDnsSystemdResolved *self = NM_DNS_SYSTEMD_RESOLVED (plugin);
|
||||
NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
|
||||
GArray *interfaces = g_array_new (TRUE, TRUE, sizeof(InterfaceConfig));
|
||||
GArray *interfaces = g_array_new (TRUE, TRUE, sizeof (InterfaceConfig));
|
||||
const NMDnsIPConfigData **c;
|
||||
int i;
|
||||
|
||||
@@ -288,6 +291,7 @@ update (NMDnsPlugin *plugin,
|
||||
|
||||
for (i = 0; i < interfaces->len; i++) {
|
||||
InterfaceConfig *ic = &g_array_index (interfaces, InterfaceConfig, i);
|
||||
|
||||
prepare_one_interface (self, ic);
|
||||
g_list_free (ic->configs);
|
||||
}
|
||||
@@ -330,7 +334,7 @@ resolved_proxy_created (GObject *source, GAsyncResult *r, gpointer user_data)
|
||||
|
||||
g_clear_object (&priv->init_cancellable);
|
||||
|
||||
priv->resolve = g_dbus_proxy_new_finish(r, &error);
|
||||
priv->resolve = g_dbus_proxy_new_finish (r, &error);
|
||||
|
||||
if (priv->resolve == NULL) {
|
||||
_LOGW ("failed to connect to resolved via DBus: %s", error->message);
|
||||
@@ -339,7 +343,7 @@ resolved_proxy_created (GObject *source, GAsyncResult *r, gpointer user_data)
|
||||
return;
|
||||
}
|
||||
|
||||
send_updates(self);
|
||||
send_updates (self);
|
||||
}
|
||||
|
||||
|
||||
@@ -350,8 +354,8 @@ nm_dns_systemd_resolved_init (NMDnsSystemdResolved *self)
|
||||
NMBusManager *dbus_mgr;
|
||||
GDBusConnection *connection;
|
||||
|
||||
g_queue_init(&priv->dns_updates);
|
||||
g_queue_init(&priv->domain_updates);
|
||||
g_queue_init (&priv->dns_updates);
|
||||
g_queue_init (&priv->domain_updates);
|
||||
|
||||
dbus_mgr = nm_bus_manager_get ();
|
||||
g_return_if_fail (dbus_mgr);
|
||||
|
Reference in New Issue
Block a user