summaryrefslogtreecommitdiffstats
path: root/filescan-utils.c
diff options
context:
space:
mode:
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