summaryrefslogtreecommitdiffstats
path: root/filescan-utils.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-15 14:23:29 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 14:12:02 +0100
commit2ac34f7e74087464b377b742027493810e050952 (patch)
treedb71753d182ec7c7cfc8642d6b1d04e8185e7465 /filescan-utils.c
parentaa96c699d975ee680ab7e55a6891c809976d4c40 (diff)
Fix: compile errors depending API version
Change-Id: I9c1476ab35f9bf70322ad4cd81ab0790e4d0724b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'filescan-utils.c')
-rw-r--r--filescan-utils.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/filescan-utils.c b/filescan-utils.c
index 70ca6ff..8a64e58 100644
--- a/filescan-utils.c
+++ b/filescan-utils.c
@@ -142,10 +142,13 @@ char *GetBindingDirPath(struct afb_dynapi *dynapi)
char retdir[CONTROL_MAXPATH_LEN];
ssize_t len;
- if(dynapi)
- sprintf(fd_link, "/proc/self/fd/%d", afb_dynapi_rootdir_get_fd(dynapi));
- else
- sprintf(fd_link, "/proc/self/fd/%d", afb_daemon_rootdir_get_fd());
+#ifdef USE_API_DYN
+ if (!dynapi)
+ return NULL;
+ sprintf(fd_link, "/proc/self/fd/%d", afb_dynapi_rootdir_get_fd(dynapi));
+#else
+ sprintf(fd_link, "/proc/self/fd/%d", afb_daemon_rootdir_get_fd());
+#endif
if((len = readlink(fd_link, retdir, sizeof(retdir)-1)) == -1)
{