summaryrefslogtreecommitdiffstats
path: root/common/ini/ini_config.c
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-04-10 13:39:06 -0400
committerSimo Sorce <ssorce@redhat.com>2009-04-10 17:01:54 -0400
commitb531c1872952c5f9a2a46d0a0dfe8dc63be470fd (patch)
tree648c6bddf432eeb156b4e211c161953adde97b6e /common/ini/ini_config.c
parent24967bd826ad5437a11b1431c8289b1881b52a17 (diff)
downloadsssd-b531c1872952c5f9a2a46d0a0dfe8dc63be470fd.tar.gz
sssd-b531c1872952c5f9a2a46d0a0dfe8dc63be470fd.tar.xz
sssd-b531c1872952c5f9a2a46d0a0dfe8dc63be470fd.zip
The lower level function now returns NOENT if file is not found.
Diffstat (limited to 'common/ini/ini_config.c')
-rw-r--r--common/ini/ini_config.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/ini/ini_config.c b/common/ini/ini_config.c
index 8d19b272c..4112049f3 100644
--- a/common/ini/ini_config.c
+++ b/common/ini/ini_config.c
@@ -145,7 +145,7 @@ static int ini_to_collection(const char *filename,
if (file == NULL) {
error = errno;
TRACE_ERROR_NUMBER("Failed to open file - but this is OK", error);
- return EOK;
+ return ENOENT;
}
/* Open the collection of errors */
@@ -416,7 +416,8 @@ int config_for_app(const char *application,
TRACE_INFO_STRING("Reading master file:", config_file);
error = ini_to_collection(config_file, *ini_config,
error_level, pass_common);
- if (error != EOK) {
+ /* ENOENT and EOK are Ok */
+ if (error && (error != ENOENT)) {
TRACE_ERROR_NUMBER("Failed to read master file", error);
/* In case of error when we created collection - delete it */
if(error && created) {
@@ -468,7 +469,8 @@ int config_for_app(const char *application,
error = ini_to_collection(file_name, *ini_config,
error_level, pass_specific);
free(file_name);
- if (error) {
+ /* ENOENT and EOK are Ok */
+ if (error && (error != ENOENT)) {
TRACE_ERROR_NUMBER("Failed to read specific application file", error);
/* In case of error when we created collection - delete it */
if (error && created) {