From 9cdebd57cf048c1c9ba89943f6ec2f9012bad6fc Mon Sep 17 00:00:00 2001 From: Clément Bénier Date: Tue, 28 Aug 2018 14:29:55 +0200 Subject: Static lib: pass afb-helpers to a static 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 - use the GNUinstalldirs module to set the destination directories. Change-Id: Ic88105d140edabcc96b091fb23f215db11ccb8c6 Signed-off-by: Clément Bénier Signed-off-by: Romain Forlot --- 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 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 -- cgit 1.2.3-korg