summaryrefslogtreecommitdiffstats
path: root/binding/task-manager-binding.c
diff options
context:
space:
mode:
authorVitaly Wool <vitaly.wool@konsulko.com>2019-05-01 13:43:38 +0000
committerVitaly Wool <vitaly.wool@konsulko.com>2019-05-03 13:18:17 +0000
commit8e33f71b6177eb656f49e0b11658ab5c84d7e8de (patch)
tree2a06a108c446b967cb99998d2c16be780bae4ff3 /binding/task-manager-binding.c
parent76902e81dcdae6c7a936821133d519b875d30950 (diff)
Fix error handling
Bail out immediately if fopen() fails, do not try to proceed. Change-Id: Ib3ca73b3aefbb7f3c6de799ff8676a1f13e5479e Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com> Bug-AGL: SPEC-2378
Diffstat (limited to 'binding/task-manager-binding.c')
-rw-r--r--binding/task-manager-binding.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/binding/task-manager-binding.c b/binding/task-manager-binding.c
index 2780f84..5a2bc78 100644
--- a/binding/task-manager-binding.c
+++ b/binding/task-manager-binding.c
@@ -147,6 +147,7 @@ void get_extra_info(struct afb_req request)
if (fsched == NULL) {
afb_req_fail(request, "Failed", "Error processing arguments.");
+ return;
}
else {
json_object_object_add(json_obj, "tid", json_object_new_int(tid));
@@ -187,6 +188,7 @@ void get_load_avg(struct afb_req request)
if (floadAvg == NULL) {
afb_req_fail(request, "Failed", "Error processing arguments.");
+ return;
}
else {
fscanf(floadAvg, "%4f%4*f%4*f", &value);