mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 10:08:05 +02:00
all: replace g_strerror() calls with nm_strerror_native()
This commit is contained in:
parent
737ab51472
commit
a4fb6ddfca
26 changed files with 84 additions and 84 deletions
|
|
@ -50,7 +50,7 @@ _get_contents_error (GError **error, int errsv, const char *format, ...)
|
||||||
G_FILE_ERROR,
|
G_FILE_ERROR,
|
||||||
g_file_error_from_errno (errsv),
|
g_file_error_from_errno (errsv),
|
||||||
"%s: %s",
|
"%s: %s",
|
||||||
msg, g_strerror (errsv));
|
msg, nm_strerror_native (errsv));
|
||||||
g_free (msg);
|
g_free (msg);
|
||||||
}
|
}
|
||||||
return -errsv;
|
return -errsv;
|
||||||
|
|
@ -302,7 +302,7 @@ nm_utils_file_get_contents (int dirfd,
|
||||||
g_file_error_from_errno (errsv),
|
g_file_error_from_errno (errsv),
|
||||||
"Failed to open file \"%s\" with openat: %s",
|
"Failed to open file \"%s\" with openat: %s",
|
||||||
filename,
|
filename,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return -NM_ERRNO_NATIVE (errsv);
|
return -NM_ERRNO_NATIVE (errsv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -315,7 +315,7 @@ nm_utils_file_get_contents (int dirfd,
|
||||||
g_file_error_from_errno (errsv),
|
g_file_error_from_errno (errsv),
|
||||||
"Failed to open file \"%s\": %s",
|
"Failed to open file \"%s\": %s",
|
||||||
filename,
|
filename,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return -NM_ERRNO_NATIVE (errsv);
|
return -NM_ERRNO_NATIVE (errsv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -364,7 +364,7 @@ nm_utils_file_set_contents (const char *filename,
|
||||||
g_file_error_from_errno (errsv),
|
g_file_error_from_errno (errsv),
|
||||||
"failed to create file %s: %s",
|
"failed to create file %s: %s",
|
||||||
tmp_name,
|
tmp_name,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -383,7 +383,7 @@ nm_utils_file_set_contents (const char *filename,
|
||||||
g_file_error_from_errno (errsv),
|
g_file_error_from_errno (errsv),
|
||||||
"failed to write to file %s: %s",
|
"failed to write to file %s: %s",
|
||||||
tmp_name,
|
tmp_name,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -412,7 +412,7 @@ nm_utils_file_set_contents (const char *filename,
|
||||||
g_file_error_from_errno (errsv),
|
g_file_error_from_errno (errsv),
|
||||||
"failed to fsync %s: %s",
|
"failed to fsync %s: %s",
|
||||||
tmp_name,
|
tmp_name,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -428,7 +428,7 @@ nm_utils_file_set_contents (const char *filename,
|
||||||
"failed to rename %s to %s: %s",
|
"failed to rename %s to %s: %s",
|
||||||
tmp_name,
|
tmp_name,
|
||||||
filename,
|
filename,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -705,7 +705,7 @@ nm_utils_error_set_literal (GError **error, int error_code, const char *literal)
|
||||||
NM_UTILS_ERROR_UNKNOWN, \
|
NM_UTILS_ERROR_UNKNOWN, \
|
||||||
fmt, \
|
fmt, \
|
||||||
##__VA_ARGS__, \
|
##__VA_ARGS__, \
|
||||||
g_strerror (({ \
|
nm_strerror_native (({ \
|
||||||
const int _errsv = (errsv); \
|
const int _errsv = (errsv); \
|
||||||
\
|
\
|
||||||
( _errsv >= 0 \
|
( _errsv >= 0 \
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ static const char *
|
||||||
acd_error_to_string (int error)
|
acd_error_to_string (int error)
|
||||||
{
|
{
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
return g_strerror (-error);
|
return nm_strerror_native (-error);
|
||||||
|
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case _N_ACD_E_SUCCESS:
|
case _N_ACD_E_SUCCESS:
|
||||||
|
|
|
||||||
|
|
@ -10172,9 +10172,9 @@ share_init (NMDevice *self, GError **error)
|
||||||
} else if (!nm_platform_sysctl_set (nm_device_get_platform (self), NMP_SYSCTL_PATHID_ABSOLUTE ("/proc/sys/net/ipv4/ip_forward"), "1")) {
|
} else if (!nm_platform_sysctl_set (nm_device_get_platform (self), NMP_SYSCTL_PATHID_ABSOLUTE ("/proc/sys/net/ipv4/ip_forward"), "1")) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGD (LOGD_SHARING, "share: error enabling IPv4 forwarding: (%d) %s",
|
_LOGD (LOGD_SHARING, "share: error enabling IPv4 forwarding: (%d) %s",
|
||||||
errsv, g_strerror (errsv));
|
errsv, nm_strerror_native (errsv));
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"cannot set ipv4/ip_forward: %s", g_strerror (errsv));
|
"cannot set ipv4/ip_forward: %s", nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
|
||||||
&chassis_id, &chassis_id_len);
|
&chassis_id, &chassis_id_len);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"failed reading chassis-id: %s", g_strerror (-r));
|
"failed reading chassis-id: %s", nm_strerror_native (-r));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (chassis_id_len < 1) {
|
if (chassis_id_len < 1) {
|
||||||
|
|
@ -396,7 +396,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
|
||||||
&port_id, &port_id_len);
|
&port_id, &port_id_len);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"failed reading port-id: %s", g_strerror (-r));
|
"failed reading port-id: %s", nm_strerror_native (-r));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (port_id_len < 1) {
|
if (port_id_len < 1) {
|
||||||
|
|
@ -412,7 +412,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
|
||||||
r = sd_lldp_neighbor_get_destination_address (neighbor_sd, &neigh->destination_address);
|
r = sd_lldp_neighbor_get_destination_address (neighbor_sd, &neigh->destination_address);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"failed getting destination address: %s", g_strerror (-r));
|
"failed getting destination address: %s", nm_strerror_native (-r));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -463,7 +463,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
|
||||||
r = sd_lldp_neighbor_tlv_rewind (neighbor_sd);
|
r = sd_lldp_neighbor_tlv_rewind (neighbor_sd);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"failed reading tlv (rewind): %s", g_strerror (-r));
|
"failed reading tlv (rewind): %s", nm_strerror_native (-r));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
@ -475,7 +475,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
|
||||||
if (r == -ENXIO)
|
if (r == -ENXIO)
|
||||||
continue;
|
continue;
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"failed reading tlv: %s", g_strerror (-r));
|
"failed reading tlv: %s", nm_strerror_native (-r));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -625,7 +625,7 @@ out:
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
|
|
||||||
nm_log_dbg (LOGD_DHCP, "dhcp: could not remove pid file \"%s\": %s (%d)",
|
nm_log_dbg (LOGD_DHCP, "dhcp: could not remove pid file \"%s\": %s (%d)",
|
||||||
pid_file, g_strerror (errsv), errsv);
|
pid_file, nm_strerror_native (errsv), errsv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -598,12 +598,12 @@ stop (NMDhcpClient *client, gboolean release)
|
||||||
if (priv->conf_file)
|
if (priv->conf_file)
|
||||||
if (remove (priv->conf_file) == -1) {
|
if (remove (priv->conf_file) == -1) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGD ("could not remove dhcp config file \"%s\": %d (%s)", priv->conf_file, errsv, g_strerror (errsv));
|
_LOGD ("could not remove dhcp config file \"%s\": %d (%s)", priv->conf_file, errsv, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
if (priv->pid_file) {
|
if (priv->pid_file) {
|
||||||
if (remove (priv->pid_file) == -1) {
|
if (remove (priv->pid_file) == -1) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGD ("could not remove dhcp pid file \"%s\": %s (%d)", priv->pid_file, g_strerror (errsv), errsv);
|
_LOGD ("could not remove dhcp pid file \"%s\": %s (%d)", priv->pid_file, nm_strerror_native (errsv), errsv);
|
||||||
}
|
}
|
||||||
nm_clear_g_free (&priv->pid_file);
|
nm_clear_g_free (&priv->pid_file);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ stop (NMDhcpClient *client, gboolean release)
|
||||||
if (priv->pid_file) {
|
if (priv->pid_file) {
|
||||||
if (remove (priv->pid_file) == -1) {
|
if (remove (priv->pid_file) == -1) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGD ("could not remove dhcp pid file \"%s\": %d (%s)", priv->pid_file, errsv, g_strerror (errsv));
|
_LOGD ("could not remove dhcp pid file \"%s\": %d (%s)", priv->pid_file, errsv, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
g_free (priv->pid_file);
|
g_free (priv->pid_file);
|
||||||
priv->pid_file = NULL;
|
priv->pid_file = NULL;
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ stop (NMDhcpClient *client, gboolean release)
|
||||||
if (priv->pid_file) {
|
if (priv->pid_file) {
|
||||||
if (remove (priv->pid_file) == -1) {
|
if (remove (priv->pid_file) == -1) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGD ("could not remove dhcp pid file \"%s\": %d (%s)", priv->pid_file, errsv, g_strerror (errsv));
|
_LOGD ("could not remove dhcp pid file \"%s\": %d (%s)", priv->pid_file, errsv, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -677,7 +677,7 @@ write_resolv_conf_contents (FILE *f,
|
||||||
NM_MANAGER_ERROR,
|
NM_MANAGER_ERROR,
|
||||||
NM_MANAGER_ERROR_FAILED,
|
NM_MANAGER_ERROR_FAILED,
|
||||||
"Could not write " _PATH_RESCONF ": %s",
|
"Could not write " _PATH_RESCONF ": %s",
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
errno = errsv;
|
errno = errsv;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -749,7 +749,7 @@ dispatch_resolvconf (NMDnsManager *self,
|
||||||
NM_MANAGER_ERROR_FAILED,
|
NM_MANAGER_ERROR_FAILED,
|
||||||
"Could not write to %s: %s",
|
"Could not write to %s: %s",
|
||||||
RESOLVCONF_PATH,
|
RESOLVCONF_PATH,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -887,9 +887,9 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
NM_MANAGER_ERROR_FAILED,
|
NM_MANAGER_ERROR_FAILED,
|
||||||
"Could not open %s: %s",
|
"Could not open %s: %s",
|
||||||
MY_RESOLV_CONF_TMP,
|
MY_RESOLV_CONF_TMP,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
_LOGT ("update-resolv-conf: open temporary file %s failed (%s)",
|
_LOGT ("update-resolv-conf: open temporary file %s failed (%s)",
|
||||||
MY_RESOLV_CONF_TMP, g_strerror (errsv));
|
MY_RESOLV_CONF_TMP, nm_strerror_native (errsv));
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -897,7 +897,7 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
if (!success) {
|
if (!success) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGT ("update-resolv-conf: write temporary file %s failed (%s)",
|
_LOGT ("update-resolv-conf: write temporary file %s failed (%s)",
|
||||||
MY_RESOLV_CONF_TMP, g_strerror (errsv));
|
MY_RESOLV_CONF_TMP, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fclose (f) < 0) {
|
if (fclose (f) < 0) {
|
||||||
|
|
@ -911,9 +911,9 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
NM_MANAGER_ERROR_FAILED,
|
NM_MANAGER_ERROR_FAILED,
|
||||||
"Could not close %s: %s",
|
"Could not close %s: %s",
|
||||||
MY_RESOLV_CONF_TMP,
|
MY_RESOLV_CONF_TMP,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
_LOGT ("update-resolv-conf: close temporary file %s failed (%s)",
|
_LOGT ("update-resolv-conf: close temporary file %s failed (%s)",
|
||||||
MY_RESOLV_CONF_TMP, g_strerror (errsv));
|
MY_RESOLV_CONF_TMP, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
} else if (!success)
|
} else if (!success)
|
||||||
|
|
@ -926,9 +926,9 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
NM_MANAGER_ERROR_FAILED,
|
NM_MANAGER_ERROR_FAILED,
|
||||||
"Could not replace %s: %s",
|
"Could not replace %s: %s",
|
||||||
MY_RESOLV_CONF,
|
MY_RESOLV_CONF,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
_LOGT ("update-resolv-conf: failed to rename temporary file %s to %s (%s)",
|
_LOGT ("update-resolv-conf: failed to rename temporary file %s to %s (%s)",
|
||||||
MY_RESOLV_CONF_TMP, MY_RESOLV_CONF, g_strerror (errsv));
|
MY_RESOLV_CONF_TMP, MY_RESOLV_CONF, nm_strerror_native (errsv));
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -963,10 +963,10 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
NM_MANAGER_ERROR_FAILED,
|
NM_MANAGER_ERROR_FAILED,
|
||||||
"Could not unlink %s: %s",
|
"Could not unlink %s: %s",
|
||||||
RESOLV_CONF_TMP,
|
RESOLV_CONF_TMP,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
_LOGT ("update-resolv-conf: write internal file %s succeeded "
|
_LOGT ("update-resolv-conf: write internal file %s succeeded "
|
||||||
"but canot delete temporary file %s: %s",
|
"but canot delete temporary file %s: %s",
|
||||||
MY_RESOLV_CONF, RESOLV_CONF_TMP, g_strerror (errsv));
|
MY_RESOLV_CONF, RESOLV_CONF_TMP, nm_strerror_native (errsv));
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -978,10 +978,10 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
"Could not create symlink %s pointing to %s: %s",
|
"Could not create symlink %s pointing to %s: %s",
|
||||||
RESOLV_CONF_TMP,
|
RESOLV_CONF_TMP,
|
||||||
MY_RESOLV_CONF,
|
MY_RESOLV_CONF,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
_LOGT ("update-resolv-conf: write internal file %s succeeded "
|
_LOGT ("update-resolv-conf: write internal file %s succeeded "
|
||||||
"but failed to symlink %s: %s",
|
"but failed to symlink %s: %s",
|
||||||
MY_RESOLV_CONF, RESOLV_CONF_TMP, g_strerror (errsv));
|
MY_RESOLV_CONF, RESOLV_CONF_TMP, nm_strerror_native (errsv));
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -993,10 +993,10 @@ update_resolv_conf (NMDnsManager *self,
|
||||||
"Could not rename %s to %s: %s",
|
"Could not rename %s to %s: %s",
|
||||||
RESOLV_CONF_TMP,
|
RESOLV_CONF_TMP,
|
||||||
_PATH_RESCONF,
|
_PATH_RESCONF,
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
_LOGT ("update-resolv-conf: write internal file %s succeeded "
|
_LOGT ("update-resolv-conf: write internal file %s succeeded "
|
||||||
"but failed to rename temporary symlink %s to %s: %s",
|
"but failed to rename temporary symlink %s to %s: %s",
|
||||||
MY_RESOLV_CONF, RESOLV_CONF_TMP, _PATH_RESCONF, g_strerror (errsv));
|
MY_RESOLV_CONF, RESOLV_CONF_TMP, _PATH_RESCONF, nm_strerror_native (errsv));
|
||||||
return SR_ERROR;
|
return SR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,13 +130,13 @@ nm_main_utils_ensure_statedir ()
|
||||||
&& parent[1] != '\0'
|
&& parent[1] != '\0'
|
||||||
&& g_mkdir_with_parents (parent, 0755) != 0) {
|
&& g_mkdir_with_parents (parent, 0755) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
fprintf (stderr, "Cannot create parents for '%s': %s", NMSTATEDIR, g_strerror (errsv));
|
fprintf (stderr, "Cannot create parents for '%s': %s", NMSTATEDIR, nm_strerror_native (errsv));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
/* Ensure state directory exists */
|
/* Ensure state directory exists */
|
||||||
if (g_mkdir_with_parents (NMSTATEDIR, 0700) != 0) {
|
if (g_mkdir_with_parents (NMSTATEDIR, 0700) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
fprintf (stderr, "Cannot create '%s': %s", NMSTATEDIR, g_strerror (errsv));
|
fprintf (stderr, "Cannot create '%s': %s", NMSTATEDIR, nm_strerror_native (errsv));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ nm_main_utils_ensure_rundir ()
|
||||||
/* Setup runtime directory */
|
/* Setup runtime directory */
|
||||||
if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
|
if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, g_strerror (errsv));
|
fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, nm_strerror_native (errsv));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ nm_main_utils_ensure_rundir ()
|
||||||
if (g_mkdir (NM_CONFIG_DEVICE_STATE_DIR, 0755) != 0) {
|
if (g_mkdir (NM_CONFIG_DEVICE_STATE_DIR, 0755) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
if (errsv != EEXIST) {
|
if (errsv != EEXIST) {
|
||||||
fprintf (stderr, _("Cannot create '%s': %s"), NM_CONFIG_DEVICE_STATE_DIR, g_strerror (errsv));
|
fprintf (stderr, _("Cannot create '%s': %s"), NM_CONFIG_DEVICE_STATE_DIR, nm_strerror_native (errsv));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ main (int argc, char *argv[])
|
||||||
if (daemon (0, 0) < 0) {
|
if (daemon (0, 0) < 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
fprintf (stderr, _("Could not daemonize: %s [error %u]\n"),
|
fprintf (stderr, _("Could not daemonize: %s [error %u]\n"),
|
||||||
g_strerror (errsv),
|
nm_strerror_native (errsv),
|
||||||
errsv);
|
errsv);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ send_rs (NMNDisc *ndisc, GError **error)
|
||||||
errsv = nm_errno_native (errsv);
|
errsv = nm_errno_native (errsv);
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"%s (%d)",
|
"%s (%d)",
|
||||||
g_strerror (errsv), errsv);
|
nm_strerror_native (errsv), errsv);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -469,7 +469,7 @@ send_ra (NMNDisc *ndisc, GError **error)
|
||||||
errsv = nm_errno_native (errsv);
|
errsv = nm_errno_native (errsv);
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"%s (%d)",
|
"%s (%d)",
|
||||||
g_strerror (errsv), errsv);
|
nm_strerror_native (errsv), errsv);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -600,7 +600,7 @@ nm_lndp_ndisc_new (NMPlatform *platform,
|
||||||
errsv = nm_errno_native (errsv);
|
errsv = nm_errno_native (errsv);
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"failure creating libndp socket: %s (%d)",
|
"failure creating libndp socket: %s (%d)",
|
||||||
g_strerror (errsv), errsv);
|
nm_strerror_native (errsv), errsv);
|
||||||
g_object_unref (ndisc);
|
g_object_unref (ndisc);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ main (int argc, char *argv[])
|
||||||
if (daemon (0, 0) < 0) {
|
if (daemon (0, 0) < 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
fprintf (stderr, _("Could not daemonize: %s [error %u]\n"),
|
fprintf (stderr, _("Could not daemonize: %s [error %u]\n"),
|
||||||
g_strerror (errsv),
|
nm_strerror_native (errsv),
|
||||||
errsv);
|
errsv);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7220,7 +7220,7 @@ rfkill_change (NMManager *self, const char *desc, RfKillType rtype, gboolean ena
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGW (LOGD_RFKILL, "rfkill: (%s): failed to change Wi-Fi killswitch state: (%d) %s",
|
_LOGW (LOGD_RFKILL, "rfkill: (%s): failed to change Wi-Fi killswitch state: (%d) %s",
|
||||||
desc, errsv, g_strerror (errsv));
|
desc, errsv, nm_strerror_native (errsv));
|
||||||
} else if (len == sizeof (event)) {
|
} else if (len == sizeof (event)) {
|
||||||
_LOGI (LOGD_RFKILL, "rfkill: %s hardware radio set %s",
|
_LOGI (LOGD_RFKILL, "rfkill: %s hardware radio set %s",
|
||||||
desc, enabled ? "enabled" : "disabled");
|
desc, enabled ? "enabled" : "disabled");
|
||||||
|
|
|
||||||
|
|
@ -554,7 +554,7 @@ _get_hostname (NMPolicy *self)
|
||||||
if (gethostname (hostname, HOST_NAME_BUFSIZE -1) != 0) {
|
if (gethostname (hostname, HOST_NAME_BUFSIZE -1) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGT (LOGD_DNS, "get-hostname: couldn't get the system hostname: (%d) %s",
|
_LOGT (LOGD_DNS, "get-hostname: couldn't get the system hostname: (%d) %s",
|
||||||
errsv, g_strerror (errsv));
|
errsv, nm_strerror_native (errsv));
|
||||||
g_free (hostname);
|
g_free (hostname);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ G_DEFINE_TYPE (NMLinuxPlatform, nm_linux_platform, NM_TYPE_PLATFORM)
|
||||||
_LOG_print (__level, __domain, __errsv, self, \
|
_LOG_print (__level, __domain, __errsv, self, \
|
||||||
_NM_UTILS_MACRO_FIRST (__VA_ARGS__) ": %s (%d)" \
|
_NM_UTILS_MACRO_FIRST (__VA_ARGS__) ": %s (%d)" \
|
||||||
_NM_UTILS_MACRO_REST (__VA_ARGS__), \
|
_NM_UTILS_MACRO_REST (__VA_ARGS__), \
|
||||||
g_strerror (__errsv), __errsv); \
|
nm_strerror_native (__errsv), __errsv); \
|
||||||
} \
|
} \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
|
|
@ -510,7 +510,7 @@ wait_for_nl_response_to_string (WaitForNlResponseResult seq_result,
|
||||||
if (seq_result < 0) {
|
if (seq_result < 0) {
|
||||||
nm_utils_strbuf_append (&buf, &buf_size, "failure %d (%s%s%s)",
|
nm_utils_strbuf_append (&buf, &buf_size, "failure %d (%s%s%s)",
|
||||||
-((int) seq_result),
|
-((int) seq_result),
|
||||||
g_strerror (-((int) seq_result)),
|
nm_strerror_native (-((int) seq_result)),
|
||||||
errmsg ? " - " : "",
|
errmsg ? " - " : "",
|
||||||
errmsg ?: "");
|
errmsg ?: "");
|
||||||
}
|
}
|
||||||
|
|
@ -5055,7 +5055,7 @@ again:
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
if (errsv == EINTR && try_count++ < 100)
|
if (errsv == EINTR && try_count++ < 100)
|
||||||
goto again;
|
goto again;
|
||||||
_LOGD ("netlink: nl-send-nlmsghdr: failed sending message: %s (%d)", g_strerror (errsv), errsv);
|
_LOGD ("netlink: nl-send-nlmsghdr: failed sending message: %s (%d)", nm_strerror_native (errsv), errsv);
|
||||||
return -nm_errno_from_native (errsv);
|
return -nm_errno_from_native (errsv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7580,7 +7580,7 @@ ip_route_get (NMPlatform *platform,
|
||||||
nle = _nl_send_nlmsghdr (platform, &req.n, &seq_result, NULL, DELAYED_ACTION_RESPONSE_TYPE_ROUTE_GET, &route);
|
nle = _nl_send_nlmsghdr (platform, &req.n, &seq_result, NULL, DELAYED_ACTION_RESPONSE_TYPE_ROUTE_GET, &route);
|
||||||
if (nle < 0) {
|
if (nle < 0) {
|
||||||
_LOGE ("get-route: failure sending netlink request \"%s\" (%d)",
|
_LOGE ("get-route: failure sending netlink request \"%s\" (%d)",
|
||||||
g_strerror (-nle), -nle);
|
nm_strerror_native (-nle), -nle);
|
||||||
return -NME_UNSPEC;
|
return -NME_UNSPEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ ethtool_call_ifindex (int ifindex, gpointer edata)
|
||||||
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
||||||
ifindex,
|
ifindex,
|
||||||
_ethtool_data_to_string (edata, sbuf, sizeof (sbuf)),
|
_ethtool_data_to_string (edata, sbuf, sizeof (sbuf)),
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -487,7 +487,7 @@ nmp_utils_ethtool_get_features (int ifindex)
|
||||||
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
||||||
ifindex,
|
ifindex,
|
||||||
"get-features",
|
"get-features",
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -618,7 +618,7 @@ nmp_utils_ethtool_set_features (int ifindex,
|
||||||
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
||||||
ifindex,
|
ifindex,
|
||||||
"set-features",
|
"set-features",
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -654,7 +654,7 @@ nmp_utils_ethtool_set_features (int ifindex,
|
||||||
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failure setting features (%s)",
|
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failure setting features (%s)",
|
||||||
ifindex,
|
ifindex,
|
||||||
"set-features",
|
"set-features",
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -764,7 +764,7 @@ nmp_utils_ethtool_supports_vlans (int ifindex)
|
||||||
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
||||||
ifindex,
|
ifindex,
|
||||||
"support-vlans",
|
"support-vlans",
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -803,7 +803,7 @@ nmp_utils_ethtool_get_peer_ifindex (int ifindex)
|
||||||
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
nm_log_trace (LOGD_PLATFORM, "ethtool[%d]: %s: failed creating ethtool socket: %s",
|
||||||
ifindex,
|
ifindex,
|
||||||
"get-peer-ifindex",
|
"get-peer-ifindex",
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1050,7 +1050,7 @@ nmp_utils_mii_supports_carrier_detect (int ifindex)
|
||||||
if ((r = socket_handle_init (&shandle, ifindex)) < 0) {
|
if ((r = socket_handle_init (&shandle, ifindex)) < 0) {
|
||||||
nm_log_trace (LOGD_PLATFORM, "mii[%d]: carrier-detect no: failed creating ethtool socket: %s",
|
nm_log_trace (LOGD_PLATFORM, "mii[%d]: carrier-detect no: failed creating ethtool socket: %s",
|
||||||
ifindex,
|
ifindex,
|
||||||
g_strerror (-r));
|
nm_strerror_native (-r));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ _netns_new (GError **error)
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"Failed opening netns: %s",
|
"Failed opening netns: %s",
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
errno = errsv;
|
errno = errsv;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -342,7 +342,7 @@ _netns_new (GError **error)
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||||
"Failed opening mntns: %s",
|
"Failed opening mntns: %s",
|
||||||
g_strerror (errsv));
|
nm_strerror_native (errsv));
|
||||||
nm_close (fd_net);
|
nm_close (fd_net);
|
||||||
errno = errsv;
|
errno = errsv;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -385,14 +385,14 @@ _netns_switch_push (GArray *netns_stack,
|
||||||
&& !_stack_current_ns_types (netns_stack, self, CLONE_NEWNET)
|
&& !_stack_current_ns_types (netns_stack, self, CLONE_NEWNET)
|
||||||
&& _setns (self, CLONE_NEWNET) != 0) {
|
&& _setns (self, CLONE_NEWNET) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "failed to switch netns: %s", g_strerror (errsv));
|
_LOGE (self, "failed to switch netns: %s", nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ( NM_FLAGS_HAS (ns_types, CLONE_NEWNS)
|
if ( NM_FLAGS_HAS (ns_types, CLONE_NEWNS)
|
||||||
&& !_stack_current_ns_types (netns_stack, self, CLONE_NEWNS)
|
&& !_stack_current_ns_types (netns_stack, self, CLONE_NEWNS)
|
||||||
&& _setns (self, CLONE_NEWNS) != 0) {
|
&& _setns (self, CLONE_NEWNS) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "failed to switch mntns: %s", g_strerror (errsv));
|
_LOGE (self, "failed to switch mntns: %s", nm_strerror_native (errsv));
|
||||||
|
|
||||||
/* try to fix the mess by returning to the previous netns. */
|
/* try to fix the mess by returning to the previous netns. */
|
||||||
if ( NM_FLAGS_HAS (ns_types, CLONE_NEWNET)
|
if ( NM_FLAGS_HAS (ns_types, CLONE_NEWNET)
|
||||||
|
|
@ -401,7 +401,7 @@ _netns_switch_push (GArray *netns_stack,
|
||||||
if ( self
|
if ( self
|
||||||
&& _setns (self, CLONE_NEWNET) != 0) {
|
&& _setns (self, CLONE_NEWNET) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "failed to restore netns: %s", g_strerror (errsv));
|
_LOGE (self, "failed to restore netns: %s", nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -428,7 +428,7 @@ _netns_switch_pop (GArray *netns_stack,
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
} else if (_setns (current, CLONE_NEWNET) != 0) {
|
} else if (_setns (current, CLONE_NEWNET) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "failed to switch netns: %s", g_strerror (errsv));
|
_LOGE (self, "failed to switch netns: %s", nm_strerror_native (errsv));
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -440,7 +440,7 @@ _netns_switch_pop (GArray *netns_stack,
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
} else if (_setns (current, CLONE_NEWNS) != 0) {
|
} else if (_setns (current, CLONE_NEWNS) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "failed to switch mntns: %s", g_strerror (errsv));
|
_LOGE (self, "failed to switch mntns: %s", nm_strerror_native (errsv));
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -534,19 +534,19 @@ nmp_netns_new (void)
|
||||||
|
|
||||||
if (unshare (_CLONE_NS_ALL) != 0) {
|
if (unshare (_CLONE_NS_ALL) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (NULL, "failed to create new net and mnt namespace: %s", g_strerror (errsv));
|
_LOGE (NULL, "failed to create new net and mnt namespace: %s", nm_strerror_native (errsv));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mount ("", "/", "none", MS_SLAVE | MS_REC, NULL) != 0) {
|
if (mount ("", "/", "none", MS_SLAVE | MS_REC, NULL) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (NULL, "failed mount --make-rslave: %s", g_strerror (errsv));
|
_LOGE (NULL, "failed mount --make-rslave: %s", nm_strerror_native (errsv));
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (umount2 ("/sys", MNT_DETACH) != 0) {
|
if (umount2 ("/sys", MNT_DETACH) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (NULL, "failed umount /sys: %s", g_strerror (errsv));
|
_LOGE (NULL, "failed umount /sys: %s", nm_strerror_native (errsv));
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -555,7 +555,7 @@ nmp_netns_new (void)
|
||||||
|
|
||||||
if (mount ("sysfs", "/sys", "sysfs", mountflags, NULL) != 0) {
|
if (mount ("sysfs", "/sys", "sysfs", mountflags, NULL) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (NULL, "failed mount /sys: %s", g_strerror (errsv));
|
_LOGE (NULL, "failed mount /sys: %s", nm_strerror_native (errsv));
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -653,7 +653,7 @@ nmp_netns_bind_to_path (NMPNetns *self, const char *filename, int *out_fd)
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
if (errsv != EEXIST) {
|
if (errsv != EEXIST) {
|
||||||
_LOGE (self, "bind: failed to create directory %s: %s",
|
_LOGE (self, "bind: failed to create directory %s: %s",
|
||||||
dirname, g_strerror (errsv));
|
dirname, nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -661,7 +661,7 @@ nmp_netns_bind_to_path (NMPNetns *self, const char *filename, int *out_fd)
|
||||||
if ((fd = creat (filename, S_IRUSR | S_IRGRP | S_IROTH)) == -1) {
|
if ((fd = creat (filename, S_IRUSR | S_IRGRP | S_IROTH)) == -1) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "bind: failed to create %s: %s",
|
_LOGE (self, "bind: failed to create %s: %s",
|
||||||
filename, g_strerror (errsv));
|
filename, nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
nm_close (fd);
|
nm_close (fd);
|
||||||
|
|
@ -669,7 +669,7 @@ nmp_netns_bind_to_path (NMPNetns *self, const char *filename, int *out_fd)
|
||||||
if (mount (PROC_SELF_NS_NET, filename, "none", MS_BIND, NULL) != 0) {
|
if (mount (PROC_SELF_NS_NET, filename, "none", MS_BIND, NULL) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "bind: failed to mount %s to %s: %s",
|
_LOGE (self, "bind: failed to mount %s to %s: %s",
|
||||||
PROC_SELF_NS_NET, filename, g_strerror (errsv));
|
PROC_SELF_NS_NET, filename, nm_strerror_native (errsv));
|
||||||
unlink (filename);
|
unlink (filename);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -677,7 +677,7 @@ nmp_netns_bind_to_path (NMPNetns *self, const char *filename, int *out_fd)
|
||||||
if (out_fd) {
|
if (out_fd) {
|
||||||
if ((fd = open (filename, O_RDONLY | O_CLOEXEC)) == -1) {
|
if ((fd = open (filename, O_RDONLY | O_CLOEXEC)) == -1) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "bind: failed to open %s: %s", filename, g_strerror (errsv));
|
_LOGE (self, "bind: failed to open %s: %s", filename, nm_strerror_native (errsv));
|
||||||
umount2 (filename, MNT_DETACH);
|
umount2 (filename, MNT_DETACH);
|
||||||
unlink (filename);
|
unlink (filename);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -698,12 +698,12 @@ nmp_netns_bind_to_path_destroy (NMPNetns *self, const char *filename)
|
||||||
|
|
||||||
if (umount2 (filename, MNT_DETACH) != 0) {
|
if (umount2 (filename, MNT_DETACH) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "bind: failed to unmount2 %s: %s", filename, g_strerror (errsv));
|
_LOGE (self, "bind: failed to unmount2 %s: %s", filename, nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (unlink (filename) != 0) {
|
if (unlink (filename) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGE (self, "bind: failed to unlink %s: %s", filename, g_strerror (errsv));
|
_LOGE (self, "bind: failed to unlink %s: %s", filename, nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
||||||
|
|
@ -2393,7 +2393,7 @@ _test_netns_check_skip (void)
|
||||||
support_errsv = errno;
|
support_errsv = errno;
|
||||||
}
|
}
|
||||||
if (!support) {
|
if (!support) {
|
||||||
_LOGD ("setns() failed with \"%s\". This indicates missing support (valgrind?)", g_strerror (support_errsv));
|
_LOGD ("setns() failed with \"%s\". This indicates missing support (valgrind?)", nm_strerror_native (support_errsv));
|
||||||
g_test_skip ("No netns support (setns failed)");
|
g_test_skip ("No netns support (setns failed)");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ get_ifname (int ifindex, char *buffer, const char *op)
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
_LOGW (LOGD_PLATFORM | LOGD_WIFI,
|
_LOGW (LOGD_PLATFORM | LOGD_WIFI,
|
||||||
"error getting interface name for ifindex %d, operation '%s': %s (%d)",
|
"error getting interface name for ifindex %d, operation '%s': %s (%d)",
|
||||||
ifindex, op, g_strerror (errsv), errsv);
|
ifindex, op, nm_strerror_native (errsv), errsv);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4994,7 +4994,7 @@ handle_bridge_option (NMSetting *setting,
|
||||||
} else {
|
} else {
|
||||||
v = _nm_utils_ascii_str_to_int64 (value, 10, 0, 1, -1);
|
v = _nm_utils_ascii_str_to_int64 (value, 10, 0, 1, -1);
|
||||||
if (v == -1) {
|
if (v == -1) {
|
||||||
error_message = g_strerror (errno);
|
error_message = nm_strerror_native (errno);
|
||||||
goto warn;
|
goto warn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5006,7 +5006,7 @@ handle_bridge_option (NMSetting *setting,
|
||||||
case G_TYPE_UINT:
|
case G_TYPE_UINT:
|
||||||
v = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT, -1);
|
v = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT, -1);
|
||||||
if (v == -1) {
|
if (v == -1) {
|
||||||
error_message = g_strerror (errno);
|
error_message = nm_strerror_native (errno);
|
||||||
goto warn;
|
goto warn;
|
||||||
}
|
}
|
||||||
if (!nm_g_object_set_property_uint (G_OBJECT (setting), m[i].property_name, v, NULL)) {
|
if (!nm_g_object_set_property_uint (G_OBJECT (setting), m[i].property_name, v, NULL)) {
|
||||||
|
|
|
||||||
|
|
@ -10025,7 +10025,7 @@ int main (int argc, char **argv)
|
||||||
|
|
||||||
if (g_mkdir_with_parents (TEST_SCRATCH_DIR_TMP, 0755) != 0) {
|
if (g_mkdir_with_parents (TEST_SCRATCH_DIR_TMP, 0755) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_error ("failure to create test directory \"%s\": %s", TEST_SCRATCH_DIR_TMP, g_strerror (errsv));
|
g_error ("failure to create test directory \"%s\": %s", TEST_SCRATCH_DIR_TMP, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
|
|
||||||
g_test_add_func (TPATH "svUnescape", test_svUnescape);
|
g_test_add_func (TPATH "svUnescape", test_svUnescape);
|
||||||
|
|
|
||||||
|
|
@ -276,14 +276,14 @@ nms_keyfile_utils_check_file_permissions (NMSKeyfileFiletype filetype,
|
||||||
if (stat (filename, &st) != 0) {
|
if (stat (filename, &st) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||||
"cannot access file: %s", g_strerror (errsv));
|
"cannot access file: %s", nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else if (filetype == NMS_KEYFILE_FILETYPE_NMLOADED) {
|
} else if (filetype == NMS_KEYFILE_FILETYPE_NMLOADED) {
|
||||||
if (lstat (filename, &st) != 0) {
|
if (lstat (filename, &st) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||||
"cannot access file: %s", g_strerror (errsv));
|
"cannot access file: %s", nm_strerror_native (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ _internal_write_connection (NMConnection *connection,
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
|
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
|
||||||
"error chowning '%s': %s (%d)",
|
"error chowning '%s': %s (%d)",
|
||||||
path, g_strerror (errsv), errsv);
|
path, nm_strerror_native (errsv), errsv);
|
||||||
unlink (path);
|
unlink (path);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2622,7 +2622,7 @@ int main (int argc, char **argv)
|
||||||
|
|
||||||
if (g_mkdir_with_parents (TEST_SCRATCH_DIR, 0755) != 0) {
|
if (g_mkdir_with_parents (TEST_SCRATCH_DIR, 0755) != 0) {
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_error ("failure to create test directory \"%s\": %s", TEST_SCRATCH_DIR, g_strerror (errsv));
|
g_error ("failure to create test directory \"%s\": %s", TEST_SCRATCH_DIR, nm_strerror_native (errsv));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The tests */
|
/* The tests */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue