Commit 01b9b410 authored by Thomas Haller's avatar Thomas Haller

all: clean-up usage of GError

Functions that take a GError** MUST fill it in on error. There is no
need to check whether error is NULL if the function it was passed to
had a failing return value.

Likewise, a proper GError must have a non-NULL message, so there's no
need to double-check that either.
Based-on-patch-by: Dan Winship's avatarDan Winship <danw@gnome.org>
parent 7871d850
......@@ -2302,7 +2302,7 @@ nmc_activate_connection (NmCli *nmc,
/* Virtual connection may not have their interfaces created yet */
if (!device_found && !nm_connection_is_virtual (connection)) {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_CON_ACTIVATION,
"%s", local && local->message ? local->message : _("unknown error"));
"%s", local->message);
g_clear_error (&local);
return FALSE;
}
......@@ -2450,8 +2450,8 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
if (!nmc_activate_connection (nmc, connection, ifname, ap, nsp, pwds, activate_connection_cb, &error)) {
g_string_printf (nmc->return_text, _("Error: %s."),
error ? error->message : _("unknown error"));
nmc->return_value = error ? error->code : NMC_RESULT_ERROR_CON_ACTIVATION;
error->message);
nmc->return_value = error->code;
g_clear_error (&error);
nmc->should_wait--;
goto error;
......@@ -10724,7 +10724,7 @@ do_connection_export (NmCli *nmc, int argc, char **argv)
if (!nm_vpn_editor_plugin_export (plugin, path, connection, &error)) {
g_string_printf (nmc->return_text, _("Error: failed to export '%s': %s."),
nm_connection_get_id (connection), error ? error->message : "(unknown)");
nm_connection_get_id (connection), error->message);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto finish;
}
......
......@@ -812,8 +812,8 @@ nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active)
DBUS_TYPE_G_OBJECT_PATH, path,
G_TYPE_INVALID,
G_TYPE_INVALID)) {
g_warning ("Could not deactivate connection '%s': %s",
path, error ? error->message : "(unknown)");
g_warning ("Could not deactivate connection '%s': %s",
path, NM_G_ERROR_MSG (error));
g_clear_error (&error);
}
}
......
......@@ -2202,8 +2202,8 @@ device_operation_cb (DBusGProxy *proxy,
__func__,
nm_object_get_path (NM_OBJECT (info->device)),
info->method,
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code,
NM_G_ERROR_MSG (error));
}
g_clear_error (&error);
......
......@@ -457,8 +457,7 @@ replace_settings (NMRemoteConnection *self, GHashTable *new_settings)
g_warning ("%s: error updating connection %s settings: (%d) %s",
__func__,
nm_connection_get_path (NM_CONNECTION (self)),
error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
error->code, error->message);
g_clear_error (&error);
g_signal_emit (self, signals[REMOVED], 0);
......
......@@ -331,8 +331,7 @@ verify_request (NMSecretAgent *self,
NM_SECRET_AGENT_ERROR,
NM_SECRET_AGENT_ERROR_INVALID_CONNECTION,
"Invalid connection: (%d) %s",
local ? local->code : -1,
(local && local->message) ? local->message : "(unknown)");
local->code, local->message);
g_clear_error (&local);
}
......
......@@ -1515,8 +1515,7 @@ nm_utils_uuid_generate_from_string (const char *s)
if (!nm_utils_init (&error)) {
g_warning ("error initializing crypto: (%d) %s",
error ? error->code : 0,
error ? error->message : "unknown");
error->code, error->message);
if (error)
g_error_free (error);
return NULL;
......@@ -1524,8 +1523,7 @@ nm_utils_uuid_generate_from_string (const char *s)
if (!crypto_md5_hash (NULL, 0, s, strlen (s), (char *) uuid, sizeof (uuid), &error)) {
g_warning ("error generating UUID: (%d) %s",
error ? error->code : 0,
error ? error->message : "unknown");
error->code, error->message);
if (error)
g_error_free (error);
return NULL;
......
......@@ -567,8 +567,8 @@ replace_settings (NMRemoteConnection *self, GVariant *new_settings)
g_warning ("%s: error updating connection %s settings: (%d) %s",
__func__,
nm_connection_get_path (NM_CONNECTION (self)),
error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
error->code,
error->message);
g_clear_error (&error);
}
}
......
......@@ -154,7 +154,7 @@ inline static void
_nmtst_assert_success (gboolean success, GError *error, const char *file, int line)
{
if (!success || error)
g_error ("(%s:%d) FAILURE success=%d, error=%s", file, line, success, error && error->message ? error->message : "(no error)");
g_error ("(%s:%d) FAILURE success=%d, error=%s", file, line, success, error ? error->message : "(no error)");
}
#define nmtst_assert_success(success, error) _nmtst_assert_success ((success), (error), __FILE__, __LINE__)
......
......@@ -247,8 +247,7 @@ pan_connection_check_create (NMBluezDevice *self)
nm_log_dbg (LOGD_BT, "bluez[%s] added new Bluetooth connection for NAP device: '%s' (%s)", priv->path, id, uuid);
} else {
nm_log_warn (LOGD_BT, "bluez[%s] couldn't add new Bluetooth connection for NAP device: '%s' (%s): %d / %s",
priv->path, id, uuid, error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
priv->path, id, uuid, error->code, error->message);
g_clear_error (&error);
}
......
......@@ -231,8 +231,7 @@ on_proxy_acquired (GObject *object,
priv->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
if (!priv->proxy) {
nm_log_warn (LOGD_BT, "Couldn't acquire object manager proxy: %s",
error && error->message ? error->message : "(unknown)");
nm_log_warn (LOGD_BT, "Couldn't acquire object manager proxy: %s", error->message);
g_clear_error (&error);
return;
}
......
......@@ -498,7 +498,7 @@ modem_ip4_config_result (NMModem *modem,
if (error) {
_LOGW (LOGD_MB | LOGD_IP4 | LOGD_BT,
"retrieving IP4 configuration failed: (%d) %s",
error->code, error->message ? error->message : "(unknown)");
error->code, error->message);
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
} else
......@@ -728,8 +728,7 @@ bluez_connect_cb (GObject *object,
res, &error);
if (!device) {
_LOGW (LOGD_BT, "Error connecting with bluez: %s",
error && error->message ? error->message : "(unknown)");
_LOGW (LOGD_BT, "Error connecting with bluez: %s", error->message);
g_clear_error (&error);
nm_device_state_changed (NM_DEVICE (self),
......
......@@ -177,7 +177,7 @@ _update_s390_subchannels (NMDeviceEthernet *self)
dir = g_dir_open (parent_path, 0, &error);
if (!dir) {
_LOGW (LOGD_DEVICE | LOGD_HW, "failed to open directory '%s': %s",
parent_path, error && error->message ? error->message : "(unknown)");
parent_path, error->message);
g_clear_error (&error);
goto out;
}
......@@ -597,13 +597,13 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
if (!success) {
_LOGE (LOGD_DEVICE | LOGD_ETHER,
"Activation: (ethernet) couldn't send security configuration to the supplicant: %s",
error ? error->message : "<BUG>");
error->message);
g_clear_error (&error);
}
} else {
_LOGE (LOGD_DEVICE | LOGD_ETHER,
"Activation: (ethernet) couldn't build security configuration: %s",
error ? error->message : "<BUG>");
error->message);
g_clear_error (&error);
}
......
......@@ -355,7 +355,7 @@ read_device_factory_paths (void)
if (!dir) {
nm_log_warn (LOGD_HW, "device plugin: failed to open directory %s: %s",
NMPLUGINDIR,
(error && error->message) ? error->message : "(unknown)");
error->message);
g_clear_error (&error);
return NULL;
}
......@@ -499,7 +499,7 @@ nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc call
factory = create_func (&error);
if (!factory) {
nm_log_warn (LOGD_HW, "(%s): failed to initialize device factory: %s",
item, error ? error->message : "unknown");
item, NM_G_ERROR_MSG (error));
g_clear_error (&error);
g_module_close (plugin);
continue;
......
......@@ -2883,7 +2883,7 @@ nm_device_generate_connection (NMDevice *self, NMDevice *master)
&error))
{
_LOGE (LOGD_DEVICE, "master device '%s' failed to update slave connection: %s",
nm_device_get_iface (master), error ? error->message : "(unknown error)");
nm_device_get_iface (master), error->message);
g_error_free (error);
g_object_unref (connection);
return NULL;
......@@ -6631,7 +6631,7 @@ start_sharing (NMDevice *self, NMIP4Config *config)
if (!nm_dnsmasq_manager_start (priv->dnsmasq_manager, config, &error)) {
_LOGE (LOGD_SHARING, "share: (%s) failed to start dnsmasq: %s",
ip_iface, (error && error->message) ? error->message : "(unknown)");
ip_iface, error->message);
g_error_free (error);
nm_act_request_set_shared (req, FALSE);
return FALSE;
......
......@@ -2491,7 +2491,7 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *reason)
if (config == NULL) {
_LOGE (LOGD_DEVICE | LOGD_WIFI,
"Activation: (wifi) couldn't build wireless configuration: %s",
error ? error->message : "<BUG>");
error->message);
g_clear_error (&error);
*reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED;
goto out;
......@@ -2506,7 +2506,7 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *reason)
if (!nm_supplicant_interface_set_config (priv->sup_iface, config, &error)) {
_LOGE (LOGD_DEVICE | LOGD_WIFI,
"Activation: (wifi) couldn't send wireless configuration to the supplicant: %s",
error ? error->message : "<BUG>");
error->message);
g_clear_error (&error);
*reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED;
goto out;
......
......@@ -158,7 +158,7 @@ modem_ip4_config_result (NMModem *modem,
if (error) {
_LOGW (LOGD_MB | LOGD_IP4, "retrieving IPv4 configuration failed: (%d) %s",
error->code, error->message ? error->message : "(unknown)");
error->code, error->message);
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
} else {
......@@ -185,7 +185,7 @@ modem_ip6_config_result (NMModem *modem,
if (error) {
_LOGW (LOGD_MB | LOGD_IP6, "retrieving IPv6 configuration failed: (%d) %s",
error->code, error->message ? error->message : "(unknown)");
error->code, error->message);
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
return;
......
......@@ -464,7 +464,7 @@ connect_context_step (NMModemBroadband *self)
nm_log_warn (LOGD_MB, "(%s): Failed to connect '%s': %s",
nm_modem_get_uid (NM_MODEM (self)),
nm_connection_get_id (ctx->connection),
error ? error->message : "unknown error");
error->message);
g_clear_error (&error);
g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED);
......@@ -734,7 +734,7 @@ set_power_state_low_ready (MMModem *modem,
/* Log but ignore errors; not all modems support low power state */
nm_log_dbg (LOGD_MB, "(%s): failed to set modem low power state: %s",
nm_modem_get_uid (NM_MODEM (self)),
error && error->message ? error->message : "(unknown)");
NM_G_ERROR_MSG (error));
g_clear_error (&error);
}
......@@ -759,7 +759,7 @@ modem_disable_ready (MMModem *modem_iface,
} else {
nm_log_warn (LOGD_MB, "(%s): failed to disable modem: %s",
nm_modem_get_uid (NM_MODEM (self)),
error && error->message ? error->message : "(unknown)");
NM_G_ERROR_MSG (error));
nm_modem_set_prev_state (NM_MODEM (self), "disable failed");
g_clear_error (&error);
}
......@@ -778,7 +778,7 @@ modem_enable_ready (MMModem *modem_iface,
if (!mm_modem_enable_finish (modem_iface, res, &error)) {
nm_log_warn (LOGD_MB, "(%s) failed to enable modem: %s",
nm_modem_get_uid (NM_MODEM (self)),
error && error->message ? error->message : "(unknown)");
NM_G_ERROR_MSG (error));
nm_modem_set_prev_state (NM_MODEM (self), "enable failed");
g_clear_error (&error);
}
......@@ -1259,7 +1259,7 @@ get_sim_ready (MMModem *modem,
} else {
nm_log_warn (LOGD_MB, "(%s): failed to retrieve SIM object: %s",
nm_modem_get_uid (NM_MODEM (self)),
error && error->message ? error->message : "(unknown)");
NM_G_ERROR_MSG (error));
}
g_clear_error (&error);
g_object_unref (self);
......
......@@ -145,7 +145,7 @@ modem_object_added (MMManager *modem_manager,
handle_new_modem (self, modem);
else {
nm_log_warn (LOGD_MB, "failed to create modem: %s",
error ? error->message : "(unknown)");
error->message);
}
g_clear_error (&error);
}
......
......@@ -547,8 +547,8 @@ ppp_stage3_ip_config_start (NMModem *self,
} else {
nm_log_err (LOGD_PPP, "(%s): error starting PPP: (%d) %s",
nm_modem_get_uid (self),
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code,
error->message);
g_error_free (error);
nm_exported_object_clear_and_unexport (&priv->ppp_manager);
......
......@@ -380,8 +380,8 @@ dhclient_start (NMDhcpClient *client,
if (!success) {
nm_log_warn (log_domain, "(%s): failed to save DUID to %s: (%d) %s.",
iface, priv->lease_file,
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code,
error->message);
g_free (pid_file);
return FALSE;
}
......@@ -591,8 +591,8 @@ get_duid (NMDhcpClient *client)
if (error) {
nm_log_warn (LOGD_DHCP, "Failed to read leasefile '%s': (%d) %s",
priv->def_leasefile,
error ? error->code : -1,
error ? error->message : "(unknown)");
error->code,
error->message);
g_clear_error (&error);
}
}
......
......@@ -285,8 +285,7 @@ update (NMDnsPlugin *plugin,
if (!g_file_set_contents (CONFFILE, conf->str, -1, &error)) {
nm_log_warn (LOGD_DNS, "Failed to write dnsmasq config file %s: (%d) %s",
CONFFILE,
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code, error->message);
g_clear_error (&error);
goto out;
}
......
......@@ -176,8 +176,7 @@ nm_dns_plugin_child_spawn (NMDnsPlugin *self,
priv->watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) watch_cb, self);
} else {
nm_log_warn (LOGD_DNS, "Failed to spawn %s: (%d) %s",
priv->progname, error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
priv->progname, error->code, error->message);
g_clear_error (&error);
}
......
......@@ -216,8 +216,7 @@ print_config (NMConfigCmdLineOptions *config_cli)
config = nm_config_new (config_cli, NULL, &error);
if (config == NULL) {
fprintf (stderr, _("Failed to read configuration: %s\n"),
(error && error->message) ? error->message : _("unknown"));
fprintf (stderr, _("Failed to read configuration: %s\n"), error->message);
return 7;
}
......@@ -360,8 +359,8 @@ main (int argc, char *argv[])
config_cli = NULL;
if (config == NULL) {
fprintf (stderr, _("Failed to read configuration: (%d) %s\n"),
error ? error->code : -1,
(error && error->message) ? error->message : _("unknown"));
error->code,
error->message);
exit (1);
}
......@@ -415,8 +414,8 @@ main (int argc, char *argv[])
if (!parse_state_file (global_opt.state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &error)) {
nm_log_err (LOGD_CORE, "State file %s parsing failed: (%d) %s",
global_opt.state_file,
error ? error->code : -1,
(error && error->message) ? error->message : _("unknown"));
error->code,
error->message);
/* Not a hard failure */
}
g_clear_error (&error);
......
......@@ -304,8 +304,7 @@ nm_act_request_set_shared (NMActRequest *req, gboolean shared)
if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
NULL, NULL, NULL, NULL, &status, &error)) {
nm_log_warn (LOGD_SHARING, "Error executing command: (%d) %s",
error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
error->code, error->message);
g_clear_error (&error);
} else if (WEXITSTATUS (status)) {
nm_log_warn (LOGD_SHARING, "** Command returned exit status %d.",
......
......@@ -1627,7 +1627,7 @@ get_existing_connection (NMManager *self, NMDevice *device, gboolean *out_genera
_LOGW (LOGD_SETTINGS, "(%s) Couldn't save generated connection '%s': %s",
nm_device_get_iface (device),
nm_connection_get_id (connection),
(error && error->message) ? error->message : "(unknown)");
error->message);
g_clear_error (&error);
}
g_object_unref (connection);
......@@ -1660,8 +1660,8 @@ assume_connection (NMManager *self, NMDevice *device, NMSettingsConnection *conn
if (!active) {
_LOGW (LOGD_DEVICE, "assumed connection %s failed to activate: (%d) %s",
nm_connection_get_path (NM_CONNECTION (connection)),
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code,
error->message);
g_error_free (error);
return FALSE;
}
......@@ -3671,7 +3671,6 @@ deactivate_net_auth_done_cb (NMAuthChain *chain,
path = nm_auth_chain_get_data (chain, "path");
result = nm_auth_chain_get_result (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL);
active = active_connection_get_by_path (self, path);
if (auth_error) {
_LOGD (LOGD_CORE, "Disconnect request failed: %s", auth_error->message);
......@@ -3689,9 +3688,10 @@ deactivate_net_auth_done_cb (NMAuthChain *chain,
path,
NM_DEVICE_STATE_REASON_USER_REQUESTED,
&error))
g_assert (error);
nm_assert (error);
}
active = active_connection_get_by_path (self, path);
if (active) {
nm_audit_log_connection_op (NM_AUDIT_OP_CONN_DEACTIVATE,
nm_active_connection_get_settings_connection (active),
......@@ -4011,8 +4011,8 @@ _internal_enable (NMManager *self, gboolean enable)
/* Not a hard error */
_LOGW (LOGD_SUSPEND, "writing to state file %s failed: (%d) %s.",
priv->state_file,
err ? err->code : -1,
(err && err->message) ? err->message : "unknown");
err->code,
err->message);
}
}
......@@ -4973,8 +4973,8 @@ manager_radio_user_toggled (NMManager *self,
&error)) {
_LOGW (LOGD_CORE, "writing to state file %s failed: (%d) %s.",
priv->state_file,
error ? error->code : -1,
(error && error->message) ? error->message : "unknown");
error->code,
error->message);
g_clear_error (&error);
}
}
......
......@@ -697,8 +697,8 @@ auto_activate_device (gpointer user_data)
&error)) {
nm_log_info (LOGD_DEVICE, "Connection '%s' auto-activation failed: (%d) %s",
nm_settings_connection_get_id (best_connection),
error ? error->code : -1,
error ? error->message : "(none)");
error->code,
error->message);
g_error_free (error);
}
g_object_unref (subject);
......@@ -1090,8 +1090,8 @@ activate_secondary_connections (NMPolicy *policy,
else {
nm_log_warn (LOGD_DEVICE, "Secondary connection '%s (%s)' auto-activation failed: (%d) %s",
nm_settings_connection_get_id (settings_con), sec_uuid,
error ? error->code : 0,
(error && error->message) ? error->message : "unknown");
error->code,
error->message);
g_clear_error (&error);
success = FALSE;
break;
......
......@@ -304,8 +304,8 @@ get_credentials (char *username, char *password)
if (!ret) {
g_warning ("nm-ppp-plugin: (%s): could not get secrets: (%d) %s",
__func__,
err ? err->code : -1,
err->message ? err->message : "(unknown)");
err->code,
err->message);
g_error_free (err);
return -1;
}
......
......@@ -989,7 +989,7 @@ _con_get_request_start_validated (NMAuthChain *chain,
if (error) {
_LOGD (req->current, "agent "LOG_REQ_FMT" MODIFY check error: (%d) %s",
LOG_REQ_ARG (req),
error->code, error->message ? error->message : "(unknown)");
error->code, error->message);
/* Try the next agent */
request_next_agent (req);
} else {
......
......@@ -885,7 +885,7 @@ new_secrets_commit_cb (NMSettingsConnection *self,
{
if (error) {
_LOGW ("Error saving new secrets to backing storage: (%d) %s",
error->code, error->message ? error->message : "(unknown)");
error->code, error->message);
}
}
......@@ -1089,16 +1089,16 @@ get_secrets_done_cb (NMAgentManager *manager,
_LOGD ("(%s:%p) failed to update with agent secrets: (%d) %s",
setting_name,
info,
local ? local->code : -1,
(local && local->message) ? local->message : "(unknown)");
local->code,
local->message);
}
g_variant_unref (filtered_secrets);
} else {
_LOGD ("(%s:%p) failed to update with existing secrets: (%d) %s",
setting_name,
info,
local ? local->code : -1,
(local && local->message) ? local->message : "(unknown)");
local->code,
local->message);
}
applied_connection = info->applied_connection;
......
......@@ -1120,7 +1120,7 @@ nm_settings_add_connection (NMSettings *self,
nm_log_dbg (LOGD_SETTINGS, "Failed to add %s/'%s': %s",
nm_connection_get_uuid (connection),
nm_connection_get_id (connection),
add_error ? add_error->message : "(unknown)");
add_error->message);
g_clear_error (&add_error);
}
......@@ -1211,7 +1211,7 @@ pk_add_cb (NMAuthChain *chain,
error = g_error_new (NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_FAILED,
"Error checking authorization: %s",
chain_error->message ? chain_error->message : "(unknown)");
chain_error->message);
} else if (result != NM_AUTH_CALL_RESULT_YES) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_PERMISSION_DENIED,
......@@ -1294,7 +1294,7 @@ nm_settings_add_connection_dbus (NMSettings *self,
error = g_error_new (NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"The connection was invalid: %s",
tmp_error ? tmp_error->message : "(unknown)");
tmp_error->message);
g_error_free (tmp_error);
goto done;
}
......@@ -1625,7 +1625,7 @@ pk_hostname_cb (NMAuthChain *chain,
error = g_error_new (NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_FAILED,
"Error checking authorization: %s",
chain_error->message ? chain_error->message : "(unknown)");
chain_error->message);
} else if (result != NM_AUTH_CALL_RESULT_YES) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_PERMISSION_DENIED,
......@@ -1896,7 +1896,7 @@ device_realized (NMDevice *device, GParamSpec *pspec, NMSettings *self)
if (!added) {
nm_log_warn (LOGD_SETTINGS, "(%s) couldn't create default wired connection: %s",
nm_device_get_iface (device),
(error && error->message) ? error->message : "(unknown)");
error->message);
g_clear_error (&error);
return;
}
......
......@@ -98,8 +98,7 @@ constructor (GType type,
nm_log_warn (LOGD_SETTINGS, "%s.%d - invalid connection read from /etc/network/interfaces: (%d) %s",
__FILE__,
__LINE__,
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code, error->message);
goto err;
}
......
......@@ -406,8 +406,8 @@ read_connections (NMSettingsPlugin *config)
if (!dir) {
nm_log_warn (LOGD_SETTINGS, "keyfile: cannot read directory '%s': (%d) %s",
nm_keyfile_plugin_get_path (),
error ? error->code : -1,
error && error->message ? error->message : "(unknown)");
error->code,
error->message);
g_clear_error (&error);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment