mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 06:10:29 +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
This commit is contained in:
parent
b7fc328a66
commit
7b9cd2e3d7
1 changed files with 1 additions and 1 deletions
|
|
@ -2533,7 +2533,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