summaryrefslogtreecommitdiffstats
path: root/filescan-utils.c
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-08-28 14:29:55 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-17 15:03:22 +0100
commit9cdebd57cf048c1c9ba89943f6ec2f9012bad6fc (patch)
tree5eb532c616b17bc9157a0fdc853b69ead765e62f /filescan-utils.c
parent264b7abf8da063a1942da8db248c2529e6ab3ffc (diff)
Static lib: pass afb-helpers to a static libraryguppy_6.99.3guppy/6.99.36.99.3
- add afb-timer in helpers: rename ctl-timer from ctl-utilities into afb-timer - use the GNUinstalldirs module to set the destination directories. Change-Id: Ic88105d140edabcc96b091fb23f215db11ccb8c6 Signed-off-by: Clément Bénier <clement.benier@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'filescan-utils.c')
-rw-r--r--filescan-utils.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/filescan-utils.c b/filescan-utils.c
index 1a2805f..6c6cf84 100644
--- a/filescan-utils.c
+++ b/filescan-utils.c
@@ -35,7 +35,10 @@ static int ScanDir(char* searchPath, CtlScanDirModeT mode, size_t extentionLen,
struct dirent* dirEnt;
dirHandle = opendir(searchPath);
if (!dirHandle) {
- AFB_DEBUG("CONFIG-SCANNING dir=%s not readable", searchPath);
+ if(afbBindingV3root)
+ AFB_API_DEBUG_V3(afbBindingV3root, "CONFIG-SCANNING dir=%s not readable", searchPath);
+ else
+ AFB_API_DEBUG_V3(afbBindingV2data.service.closure, "CONFIG-SCANNING dir=%s not readable", searchPath);
return 0;
}
@@ -148,24 +151,14 @@ const char* GetBinderName()
return binderName;
}
-#if(AFB_BINDING_VERSION == 0 && defined(AFB_BINDING_WANT_DYNAPI))
-char *GetBindingDirPath(struct afb_dynapi *dynapi)
-#else
-char *GetBindingDirPath()
-#endif
+char *GetBindingDirPath_(int fd)
{
// A file description should not be greater than 999.999.999
char fd_link[CONTROL_MAXPATH_LEN];
char retdir[CONTROL_MAXPATH_LEN];
ssize_t len;
-#if(AFB_BINDING_VERSION == 0 && defined(AFB_BINDING_WANT_DYNAPI))
- 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
+ sprintf(fd_link, "/proc/self/fd/%d", fd);
if ((len = readlink(fd_link, retdir, sizeof(retdir) - 1)) == -1) {
perror("lstat");
@@ -178,6 +171,8 @@ char *GetBindingDirPath()
}
+
+
/**
* @brief Takes an input string and makes it upper case. The output buffer
* should be able to contains the whole input string else it will be truncated