mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 22:48:01 +02:00
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: e912b36d95
This commit is contained in:
parent
9d95e1f175
commit
ad3bbda8e3
2 changed files with 4 additions and 6 deletions
|
|
@ -380,12 +380,11 @@ run_netconfig (NMDnsManager *self, GError **error, gint *stdin_fd)
|
||||||
static void
|
static void
|
||||||
write_to_netconfig (NMDnsManager *self, gint fd, const char *key, const char *value)
|
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);
|
str = g_strdup_printf ("%s='%s'\n", key, value);
|
||||||
_LOGD ("writing to netconfig: %s", str);
|
_LOGD ("writing to netconfig: %s='%s'", key, value);
|
||||||
write (fd, str, strlen (str));
|
(void) write (fd, str, strlen (str));
|
||||||
g_free (str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static SpawnResult
|
static SpawnResult
|
||||||
|
|
|
||||||
|
|
@ -2597,7 +2597,7 @@ ifnet_update_parsers_by_connection (NMConnection *connection,
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
const char *type;
|
const char *type;
|
||||||
gboolean no_8021x = FALSE;
|
gboolean no_8021x = FALSE;
|
||||||
gboolean wired = FALSE, pppoe = TRUE;
|
gboolean wired = FALSE;
|
||||||
const char *new_name = NULL;
|
const char *new_name = NULL;
|
||||||
|
|
||||||
if (!ifnet_can_write_connection (connection, error))
|
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);
|
s_pppoe = nm_connection_get_setting_pppoe (connection);
|
||||||
if (!write_pppoe_setting (conn_name, s_pppoe))
|
if (!write_pppoe_setting (conn_name, s_pppoe))
|
||||||
goto out;
|
goto out;
|
||||||
pppoe = TRUE;
|
|
||||||
wired = TRUE;
|
wired = TRUE;
|
||||||
no_8021x = TRUE;
|
no_8021x = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue