From b503b376360cb05ecfc7f39ed4c4fe9f5a4b6ee5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 16 May 2016 16:17:09 +0200 Subject: [PATCH] ifcfg-rh: don't print warning in svGetValueInt64() Having a simple accessor print warnings is not nice. At that point there is no context as to why we are trying to read the value. Note that the function already handles and expects invalid values, it's just not clear that printing warnings from a utility function is the right thing to do. Just ignore such cases silently (at this point). It's up to the caller to print a warning or whatever. --- src/settings/plugins/ifcfg-rh/shvar.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c index 4e756349ca..4031692817 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.c +++ b/src/settings/plugins/ifcfg-rh/shvar.c @@ -38,8 +38,6 @@ #include "nm-core-internal.h" -#define PARSE_WARNING(msg...) nm_log_warn (LOGD_SETTINGS, " " msg) - /* Open the file , returning a shvarFile on success and NULL on failure. * Add a wrinkle to let the caller specify whether or not to create the file * (actually, return a structure anyway) if it doesn't exist. @@ -373,11 +371,10 @@ svGetValueInt64 (shvarFile *s, const char *key, guint base, gint64 min, gint64 m result = _nm_utils_ascii_str_to_int64 (tmp, base, min, max, fallback); errsv = errno; - if (errsv != 0) - PARSE_WARNING ("Error reading '%s' value '%s' as integer (%d)", key, tmp, errsv); g_free (tmp); + errno = errsv; return result; }