diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-08-21 10:23:18 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-08-21 10:23:18 +0200 |
commit | 88d0b8c02eaaac8843f184e379fc5a19250295e5 (patch) | |
tree | 4893d2b5cb0fdbddf0357ebd7d32009e73856cec /Audio-Common | |
parent | ba709f088f5a4718b7096003ab19083af4681155 (diff) | |
parent | d51d083be8e34000cd00ce979445eacb45a16e97 (diff) |
Merge branch 'fulup-dev'
Change-Id: I7dc6859767ac5919cf383e33bd2cf3a98698d9b4
Diffstat (limited to 'Audio-Common')
-rw-r--r-- | Audio-Common/filescan-utils.c | 15 | ||||
-rw-r--r-- | Audio-Common/filescan-utils.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Audio-Common/filescan-utils.c b/Audio-Common/filescan-utils.c index 9fa121b..4a5613f 100644 --- a/Audio-Common/filescan-utils.c +++ b/Audio-Common/filescan-utils.c @@ -27,7 +27,7 @@ // List Avaliable Configuration Files -PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext) { +PUBLIC json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode, const char *pre, const char *ext) { json_object *responseJ; char *dirPath; char* dirList= strdup(searchPath); @@ -94,8 +94,8 @@ PUBLIC const char *GetMidleName(const char*name) { int start; if (fullname[idx] == '-') { start = idx + 1; - for (int jdx = start; fullname[jdx] != '\0'; jdx++) { - if (fullname[jdx] == '-') { + for (int jdx = start; ; jdx++) { + if (fullname[jdx] == '-' || fullname[jdx] == '.' || fullname[jdx] == '\0') { fullname[jdx] = '\0'; return &fullname[start]; break; @@ -113,9 +113,12 @@ PUBLIC const char *GetBinderName() { if (binderName) return binderName; - // retrieve binder name from process name afb-name-trailer - prctl(PR_GET_NAME, psName,NULL,NULL,NULL); - binderName=GetMidleName(psName); + binderName= getenv("AFB_BINDER_NAME"); + if (!binderName) { + // retrieve binder name from process name afb-name-trailer + prctl(PR_GET_NAME, psName,NULL,NULL,NULL); + binderName=(char*)GetMidleName(psName); + } return binderName; }
\ No newline at end of file diff --git a/Audio-Common/filescan-utils.h b/Audio-Common/filescan-utils.h index eba504e..cbe15de 100644 --- a/Audio-Common/filescan-utils.h +++ b/Audio-Common/filescan-utils.h @@ -35,7 +35,7 @@ typedef enum { PUBLIC const char *GetMidleName(const char*name); PUBLIC const char *GetBinderName(); -PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext); +PUBLIC json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode, const char *pre, const char *ext); #endif /* FILESCAN_UTILS_H */ |