summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-12-12 07:29:38 +0100
committerThomas Haller <thaller@redhat.com>2018-12-12 08:22:12 +0100
commit7b9cd2e3d7206cc895fc2e27df3b7bd987da6ef5 (patch)
tree24651b97b1f57b566707b9ee08a8045caa0b1a70
parentb7fc328a66dd66f3f9d9f702e8b4a6d505ea3560 (diff)
downloadNetworkManager-7b9cd2e3d7206cc895fc2e27df3b7bd987da6ef5.tar.gz
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: dbcb1d6d97c609d53dac4a86dc45d0e2595d8857
-rw-r--r--src/nm-core-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 6f168da3ae..c0feaa9465 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -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);
}