mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-06 14:00:39 +01:00
core: fix printing error for failure reading secret-key
g_file_get_contents() fails with G_FILE_ERROR, G_FILE_ERROR_NOENT when the file does not exist. That wasn't obvious to me, nm_utils_error_is_notfound() to the rescue. Fixes:dbcb1d6d97(cherry picked from commit7b9cd2e3d7)
This commit is contained in:
parent
d0f516a2bd
commit
cfc0c6d514
1 changed files with 1 additions and 1 deletions
|
|
@ -2735,7 +2735,7 @@ _secret_key_read (guint8 **out_secret_key,
|
|||
nm_log_warn (LOGD_CORE, "secret-key: too short secret key in \"%s\" (generate new key)", NMSTATEDIR "/secret_key");
|
||||
nm_clear_g_free (&secret_key);
|
||||
} else {
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
|
||||
if (!nm_utils_error_is_notfound (error)) {
|
||||
nm_log_warn (LOGD_CORE, "secret-key: failure reading secret key in \"%s\": %s (generate new key)",
|
||||
NMSTATEDIR "/secret_key", error->message);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue