From 57a4177d8d0f5c0bbc88f18a4d593f7cf2c8ba55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 3 Aug 2018 13:00:35 +0200 Subject: [PATCH] afb-export: Provide the real path of the binding MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The path can be a symbolic link. It must be resolved to be usefull. Change-Id: I5db247fd9925065684e036d8d458c2131006f9db Signed-off-by: José Bollo --- src/afb-export.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/afb-export.c b/src/afb-export.c index 3afd8c14..e679b769 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -229,6 +229,7 @@ static struct json_object *make_settings(struct afb_export *export) struct json_object *result; struct json_object *obj; struct afb_export *iter; + char *path; /* clone the globals */ if (json_object_object_get_ex(configuration, "*", &obj)) @@ -242,8 +243,11 @@ static struct json_object *make_settings(struct afb_export *export) /* add library path */ for (iter = export ; iter && !iter->path ; iter = iter->creator); - if (iter) - json_object_object_add(result, "binding-path", json_object_new_string(iter->path)); + if (iter) { + path = realpath(iter->path, NULL); + json_object_object_add(result, "binding-path", json_object_new_string(path)); + free(path); + } export->settings = result; return result; -- 2.16.6