From e27aa5b4d74c8f7775576a93e56c94a97de1aa1c Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 2 Jul 2015 14:46:58 +0200 Subject: [PATCH] ifcfg-rh: correct the error handling for NM_CONTROLLED=no connections We ought to set an error if we're returning NULL from connection_from_file_full(). Also, printing out a warning ourselves makes no sense -- the caller communicates this if we signal an error by returning NULL. --- src/settings/plugins/ifcfg-rh/reader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 29c7854dd..6d61ec9cf 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -4736,7 +4736,8 @@ connection_from_file_full (const char *filename, connection = create_unhandled_connection (filename, parsed, "unmanaged", out_unhandled); if (!connection) - PARSE_WARNING ("NM_CONTROLLED was false but device was not uniquely identified; device will be managed"); + g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED, + "NM_CONTROLLED was false but device was not uniquely identified; device will be managed"); goto done; }