From d27e51c338cfb6b3ec483bdc5fbe33c5db3a00ee Mon Sep 17 00:00:00 2001 From: Clément Bénier Date: Tue, 28 Aug 2018 14:29:55 +0200 Subject: shared library: pass afb-helpers to shared library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add afb-timer in helpers: rename ctl-timer from ctl-utilities into afb-timer Change-Id: Ic88105d140edabcc96b091fb23f215db11ccb8c6 Signed-off-by: Clément Bénier --- filescan-utils.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'filescan-utils.c') diff --git a/filescan-utils.c b/filescan-utils.c index f58a2c9..6d302e3 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; } @@ -146,24 +149,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"); @@ -176,6 +169,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 -- cgit 1.2.3-korg