main-afb-daemon: Set AFB_ROOTDIR and AFB_WORKDIR in environment 83/16383/2
authorJose Bollo <jose.bollo@iot.bzh>
Mon, 27 Aug 2018 16:25:30 +0000 (18:25 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 28 Aug 2018 14:34:05 +0000 (16:34 +0200)
commit5dd7df31306b95a3fafe6d3238d4553107a6c70f
treefa490b8ea052be83349136b43eb5b09d19b1f191
parent870652219335d54099ba67b721164b456b7975e9
main-afb-daemon: Set AFB_ROOTDIR and AFB_WORKDIR in environment

It may be difficult to retrieve the root directory from bindings
and from process spawn by option --exec.

In the same way, well identifying the workdir might interest
programs or bindings.

So, from now, the environment variables below are set:

 - AFB_ROOTDIR: identify the rootdir as set by --rootdir
   and in the context of AGL it will be the widget directory

 - AFB_WORKDIR: identify the workdir as set by --workdir

To avoid any confusion, the function realpath is used to export
absolute path names.

Bug-AGL: SPEC-1694

Change-Id: Id272e009ca975e28aaab8b14fa2a98fbd2216e73
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-config.c
src/main-afb-daemon.c