From: Kim Gunsoo Date: Mon, 4 Apr 2016 05:36:24 +0000 (+0900) Subject: Add the sdk_toolpath member to sdbd capability. X-Git-Tag: accepted/tizen/common/20160407.132426~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F64598%2F1;p=sdk%2Ftarget%2Fsdbd.git Add the sdk_toolpath member to sdbd capability. - The sdk_toolpath member includes a path that tool of the SDK is saved. Change-Id: Ie022bed562ea0485d263593c060041a6f4fcea14 Signed-off-by: Kim Gunsoo --- diff --git a/src/sdb.c b/src/sdb.c index 1686af2..0fa0672 100644 --- a/src/sdb.c +++ b/src/sdb.c @@ -67,8 +67,6 @@ SDB_MUTEX_DEFINE( D_lock ); #endif int HOST = 0; -#define HOME_DEV_PATH tzplatform_getenv(TZ_SDK_HOME) -#define DEV_NAME tzplatform_getenv(TZ_SDK_USER_NAME) uid_t g_sdk_user_id; gid_t g_sdk_group_id; char* g_sdk_home_dir = NULL; @@ -1933,6 +1931,15 @@ static void init_capabilities(void) { snprintf(g_capabilities.syncwinsz_support, sizeof(g_capabilities.syncwinsz_support), "%s", ENABLED); + // SDK Tool path + if (SDK_TOOL_PATH == NULL) { + D("fail to get SDK tool path.\n"); + snprintf(g_capabilities.sdk_toolpath, sizeof(g_capabilities.sdk_toolpath), + "%s", UNKNOWN); + } else { + snprintf(g_capabilities.sdk_toolpath, sizeof(g_capabilities.sdk_toolpath), + "%s", SDK_TOOL_PATH); + } // Profile name ret = system_info_get_platform_string("http://tizen.org/feature/profile", &value); diff --git a/src/sdb.h b/src/sdb.h index 750e9a6..074d165 100644 --- a/src/sdb.h +++ b/src/sdb.h @@ -245,6 +245,7 @@ typedef struct platform_info { #define CPUARCH_X86 "x86" #define CAPBUF_SIZE 4096 #define CAPBUF_ITEMSIZE 32 +#define CAPBUF_L_ITEMSIZE 256 typedef struct platform_capabilities { char secure_protocol[CAPBUF_ITEMSIZE]; // enabled or disabled @@ -260,6 +261,7 @@ typedef struct platform_capabilities char cpu_arch[CAPBUF_ITEMSIZE]; // cpu architecture (ex. x86) char profile_name[CAPBUF_ITEMSIZE]; // profile name (ex. mobile) char vendor_name[CAPBUF_ITEMSIZE]; // vendor name (ex. Tizen) + char sdk_toolpath[CAPBUF_L_ITEMSIZE]; // sdk tool path char platform_version[CAPBUF_ITEMSIZE]; // platform version (ex. 2.3.0) char product_version[CAPBUF_ITEMSIZE]; // product version (ex. 1.0) @@ -388,6 +390,7 @@ int booting_done; // 0: platform booting is in progess 1: platform booting is do #define SID_INPUT 1004 #define SDK_USER_NAME tzplatform_getenv(TZ_SDK_USER_NAME) +#define SDK_TOOL_PATH tzplatform_getenv(TZ_SDK_TOOLS) extern uid_t g_sdk_user_id; extern gid_t g_sdk_group_id; extern char* g_sdk_home_dir; diff --git a/src/services.c b/src/services.c index 78cd4aa..9607462 100644 --- a/src/services.c +++ b/src/services.c @@ -885,6 +885,10 @@ static void get_capability(int fd, void *cookie) { offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "cpu_arch", g_capabilities.cpu_arch); + // SDK Tool path + offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, + "sdk_toolpath", g_capabilities.sdk_toolpath); + // Profile name offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "profile_name", g_capabilities.profile_name);