Re: [PATCH] kconfig: display an error message when aborting

From: Mike Frysinger
Date: Thu Nov 26 2009 - 14:03:57 EST


2009/11/26 Michal Marek
> On 25.11.2009 05:48, Mike Frysinger wrote:
>> If the Kconfig option causes an open() failure (like one that starts with
>> an underscore), there should be an error message shown since we're going
>> to be exiting with an error code. ÂOtherwise, the reason for the failure
>> can really only be diagnosed with strace or something similar.
>>
>> Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
>> ---
>> Âscripts/kconfig/confdata.c | Â Â2 ++
>> Â1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
>> index b55e72f..e2644b4 100644
>> --- a/scripts/kconfig/confdata.c
>> +++ b/scripts/kconfig/confdata.c
>> @@ -640,6 +640,8 @@ static int conf_split_config(void)
>> Â Â Â Â Â Â Â fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
>> Â Â Â Â Â Â Â if (fd == -1) {
>> Â Â Â Â Â Â Â Â Â Â Â if (errno != ENOENT) {
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â conf_warning("sym '%s' with path '%s': %s",
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âsym->name, path, strerror(errno));
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â res = 1;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;
>> Â Â Â Â Â Â Â Â Â Â Â }
>
> I agree that there definitely needs to be some error reporting (and not
> only here but in many more places, look e.g. at conf_write() or
> conf_write_autoconf()), but why use conf_warning() for this? It will
> prefix the error message with "include/config/auto.conf:<last lineno>",
> which has nothing to do with the path that could not be opened.

no it doesnt. it prefixes the config file name which i think is relevant.
.config:1871:warning: sym '_BF548' with path '/bf548.h': Permission denied
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/