Change-Id: I9c1476ab35f9bf70322ad4cd81ab0790e4d0724b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
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)
{