From: Sooyoung Ha Date: Wed, 15 Feb 2017 07:07:02 +0000 (+0900) Subject: source: remove redundant code X-Git-Tag: accepted/tizen/3.0/common/20170309.110602~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F114808%2F1;p=sdk%2Ftarget%2Fsdbd.git source: remove redundant code Remove some duplicated codes and redundant spaces. Change-Id: I4c42490f999eb587f7adca17b3322ca900af50c1 Signed-off-by: Sooyoung Ha --- diff --git a/src/sdb.c b/src/sdb.c index 0e3a297..5c6b2d5 100644 --- a/src/sdb.c +++ b/src/sdb.c @@ -1987,15 +1987,6 @@ static void init_capabilities(void) { } - // pkgcmd debug mode support - if(!request_capability_to_plugin(CAPABILITY_DEBUGMODE, g_capabilities.pkgcmd_debugmode, - sizeof(g_capabilities.pkgcmd_debugmode))) { - D("failed to request. (%d:%d) \n", PLUGIN_SYNC_CMD_CAPABILITY, CAPABILITY_DEBUGMODE); - snprintf(g_capabilities.pkgcmd_debugmode, sizeof(g_capabilities.pkgcmd_debugmode), - "%s", ENABLED); - } - - // Zone support ret = is_container_enabled(); snprintf(g_capabilities.zone_support, sizeof(g_capabilities.zone_support), @@ -2134,11 +2125,13 @@ static void init_capabilities(void) { snprintf(g_capabilities.appid2pid_support, sizeof(g_capabilities.appid2pid_support), "%s", ret == 1 ? ENABLED : DISABLED); - // pkgcmd debug mode support - snprintf(g_capabilities.pkgcmd_debugmode, sizeof(g_capabilities.pkgcmd_debugmode), + if(!request_capability_to_plugin(CAPABILITY_DEBUGMODE, g_capabilities.pkgcmd_debugmode, + sizeof(g_capabilities.pkgcmd_debugmode))) { + D("failed to request. (%d:%d) \n", PLUGIN_SYNC_CMD_CAPABILITY, CAPABILITY_DEBUGMODE); + snprintf(g_capabilities.pkgcmd_debugmode, sizeof(g_capabilities.pkgcmd_debugmode), "%s", ENABLED); - + } // Capability version snprintf(g_capabilities.sdbd_cap_version, sizeof(g_capabilities.sdbd_cap_version), diff --git a/src/services.c b/src/services.c index da73ff6..e1a55df 100644 --- a/src/services.c +++ b/src/services.c @@ -866,87 +866,87 @@ static void get_capability(int fd, void *cookie) { // Secure protocol support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "secure_protocol", g_capabilities.secure_protocol); + "secure_protocol", g_capabilities.secure_protocol); // Interactive shell support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "intershell_support", g_capabilities.intershell_support); + "intershell_support", g_capabilities.intershell_support); // File push/pull support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "filesync_support", g_capabilities.filesync_support); + "filesync_support", g_capabilities.filesync_support); // USB protocol support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "usbproto_support", g_capabilities.usbproto_support); + "usbproto_support", g_capabilities.usbproto_support); // Socket protocol support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "sockproto_support", g_capabilities.sockproto_support); + "sockproto_support", g_capabilities.sockproto_support); // Window size synchronization support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "syncwinsz_support", g_capabilities.syncwinsz_support); + "syncwinsz_support", g_capabilities.syncwinsz_support); // sdbd root permission offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "sdbd_rootperm", g_capabilities.root_permission); + "sdbd_rootperm", g_capabilities.root_permission); // Root command support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "rootonoff_support", g_capabilities.rootonoff_support); + "rootonoff_support", g_capabilities.rootonoff_support); // Encryption support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "encryption_support", g_capabilities.encryption_support); + "encryption_support", g_capabilities.encryption_support); // Zone support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "zone_support", g_capabilities.zone_support); + "zone_support", g_capabilities.zone_support); // Multi-User support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "multiuser_support", g_capabilities.multiuser_support); + "multiuser_support", g_capabilities.multiuser_support); // CPU Architecture of model offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "cpu_arch", g_capabilities.cpu_arch); + "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); + "sdk_toolpath", g_capabilities.sdk_toolpath); // Profile name offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "profile_name", g_capabilities.profile_name); + "profile_name", g_capabilities.profile_name); // Vendor name offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "vendor_name", g_capabilities.vendor_name); + "vendor_name", g_capabilities.vendor_name); // Target name of the launch possible offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "can_launch", g_capabilities.can_launch); + "can_launch", g_capabilities.can_launch); // Platform version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "platform_version", g_capabilities.platform_version); + "platform_version", g_capabilities.platform_version); // Product version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "product_version", g_capabilities.product_version); + "product_version", g_capabilities.product_version); // Sdbd version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "sdbd_version", g_capabilities.sdbd_version); + "sdbd_version", g_capabilities.sdbd_version); // Sdbd plugin version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "sdbd_plugin_version", g_capabilities.sdbd_plugin_version); + "sdbd_plugin_version", g_capabilities.sdbd_plugin_version); // Capability version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "sdbd_cap_version", g_capabilities.sdbd_cap_version); + "sdbd_cap_version", g_capabilities.sdbd_cap_version); // Sdbd log enable offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, @@ -956,20 +956,17 @@ static void get_capability(int fd, void *cookie) { offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "log_path", g_capabilities.log_path); - offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "pkgcmd_debugmode", g_capabilities.pkgcmd_debugmode); - // Application command support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "appcmd_support", g_capabilities.appcmd_support); // appid2pid support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "appid2pid_support", g_capabilities.appid2pid_support); + "appid2pid_support", g_capabilities.appid2pid_support); // pkgcmd debug mode support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "pkgcmd_debugmode", g_capabilities.pkgcmd_debugmode); + "pkgcmd_debugmode", g_capabilities.pkgcmd_debugmode); offset++; // for '\0' character