Commit ad3bbda8 authored by Thomas Haller's avatar Thomas Haller

core: avoid compiler warnings in write_to_netconfig() and ifnet_update_parsers_by_connection()

    src/dns/nm-dns-manager.c: In function ‘write_to_netconfig’:
    src/dns/nm-dns-manager.c:387:8: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
      write (fd, str, strlen (str));
            ^

    src/settings/plugins/ifnet/nms-ifnet-connection-parser.c: In function ‘ifnet_update_parsers_by_connection’:
    src/settings/plugins/ifnet/nms-ifnet-connection-parser.c:2600:26: error: variable ‘pppoe’ set but not used [-Werror=unused-but-set-variable]
      gboolean wired = FALSE, pppoe = TRUE;
                              ^~~~~

While at it, don't log line breaks in ifnet_update_parsers_by_connection().

Fixes: e912b36d
parent 9d95e1f1
......@@ -380,12 +380,11 @@ run_netconfig (NMDnsManager *self, GError **error, gint *stdin_fd)
static void
write_to_netconfig (NMDnsManager *self, gint fd, const char *key, const char *value)
{
char *str;
gs_free char *str = NULL;
str = g_strdup_printf ("%s='%s'\n", key, value);
_LOGD ("writing to netconfig: %s", str);
write (fd, str, strlen (str));
g_free (str);
_LOGD ("writing to netconfig: %s='%s'", key, value);
(void) write (fd, str, strlen (str));
}
static SpawnResult
......
......@@ -2597,7 +2597,7 @@ ifnet_update_parsers_by_connection (NMConnection *connection,
gboolean success = FALSE;
const char *type;
gboolean no_8021x = FALSE;
gboolean wired = FALSE, pppoe = TRUE;
gboolean wired = FALSE;
const char *new_name = NULL;
if (!ifnet_can_write_connection (connection, error))
......@@ -2630,7 +2630,6 @@ ifnet_update_parsers_by_connection (NMConnection *connection,
s_pppoe = nm_connection_get_setting_pppoe (connection);
if (!write_pppoe_setting (conn_name, s_pppoe))
goto out;
pppoe = TRUE;
wired = TRUE;
no_8021x = TRUE;
} else {
......
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