summaryrefslogtreecommitdiffstats
path: root/common/elapi
diff options
context:
space:
mode:
Diffstat (limited to 'common/elapi')
-rw-r--r--common/elapi/elapi_internal.c6
-rw-r--r--common/elapi/elapi_log.c12
2 files changed, 8 insertions, 10 deletions
diff --git a/common/elapi/elapi_internal.c b/common/elapi/elapi_internal.c
index c5ec12474..cfc2bbeee 100644
--- a/common/elapi/elapi_internal.c
+++ b/common/elapi/elapi_internal.c
@@ -197,7 +197,7 @@ int elapi_internal_add_sink(struct collection_item **sink_ref,
if (provider_cfg_item == NULL) {
/* There is no provider - return error */
TRACE_ERROR_STRING("Required key is missing in the configuration.", "Fatal Error!");
- return ENOKEY;
+ return ENOENT;
}
@@ -275,7 +275,7 @@ int elapi_internal_create_target(struct elapi_target_context **context,
if (sink_cfg_item == NULL) {
/* There is no list of targets this is bad configuration - return error */
TRACE_ERROR_STRING("Required key is missing in the configuration.", "Fatal Error!");
- return ENOKEY;
+ return ENOENT;
}
/* Allocate context */
@@ -457,7 +457,7 @@ int elapi_internal_construct_target_list(struct elapi_dispatcher *handle)
/* Check if we have any targets available */
if (handle->target_counter == 0) {
TRACE_ERROR_STRING("No targets", "");
- return ENOKEY;
+ return ENOENT;
}
TRACE_FLOW_STRING("elapi_internal_construct_target_list", "Returning success");
diff --git a/common/elapi/elapi_log.c b/common/elapi/elapi_log.c
index 122506e5a..c155fb1ac 100644
--- a/common/elapi/elapi_log.c
+++ b/common/elapi/elapi_log.c
@@ -202,9 +202,8 @@ int elapi_create_dispatcher_adv(struct elapi_dispatcher **dispatcher,
/* Allocate memory */
handle = (struct elapi_dispatcher *) malloc(sizeof(struct elapi_dispatcher));
if (handle == NULL) {
- error = errno;
- TRACE_ERROR_NUMBER("Memory allocation failed. Error", error);
- return error;
+ TRACE_ERROR_NUMBER("Memory allocation failed. Error", ENOMEM);
+ return ENOMEM;
}
/* Clean memory - we need it to be able to destroy the dispatcher at any moment */
@@ -227,10 +226,9 @@ int elapi_create_dispatcher_adv(struct elapi_dispatcher **dispatcher,
/* Check error */
if (handle->appname == NULL) {
- error = errno;
- TRACE_ERROR_NUMBER("Memory allocation failed. Error", error);
+ TRACE_ERROR_NUMBER("Memory allocation failed. Error", ENOMEM);
elapi_destroy_dispatcher(handle);
- return error;
+ return ENOMEM;
}
/* Read the ELAPI configuration and store it in the dispatcher handle */
@@ -269,7 +267,7 @@ int elapi_create_dispatcher_adv(struct elapi_dispatcher **dispatcher,
/* There is no list of targets this is bad configuration - return error */
TRACE_ERROR_STRING("No targets in the config file.", "Fatal error!");
elapi_destroy_dispatcher(handle);
- return ENOKEY;
+ return ENOENT;
}
/* Get one from config but make sure we free it later */