Code optimization, remove unused header and so on. 51/98851/1 accepted/tizen/3.0/common/20161123.140735 accepted/tizen/3.0/ivi/20161123.083640 accepted/tizen/3.0/mobile/20161123.083343 accepted/tizen/3.0/tv/20161123.083459 accepted/tizen/3.0/wearable/20161123.083554 submit/tizen_3.0/20161122.043110
authorJiyong Min <jiyong.min@samsung.com>
Mon, 21 Nov 2016 04:59:37 +0000 (13:59 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Mon, 21 Nov 2016 05:01:43 +0000 (14:01 +0900)
Change-Id: I7fcf00c388a2baeef0ab5606d825580386321b1d
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
include/media_controller_private.h [changed mode: 0644->0755]
packaging/capi-media-controller.spec [changed mode: 0644->0755]
src/media_controller_client.c
src/media_controller_db.c [changed mode: 0644->0755]
svc/media_controller_svc.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 052e0cf..99d8438
@@ -51,11 +51,11 @@ extern "C" {
        } while (0)
 
 #define mc_info(fmt, arg...) do { \
-               LOGI(FONT_COLOR_GREEN""fmt"", ##arg);     \
+               LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg);     \
        } while (0)
 
 #define mc_error(fmt, arg...) do { \
-               LOGE(FONT_COLOR_RED""fmt"", ##arg);     \
+               LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
        } while (0)
 
 #define mc_debug_fenter() do { \
@@ -68,14 +68,14 @@ extern "C" {
 
 #define mc_retm_if(expr, fmt, arg...) do { \
                if (expr) { \
-                       LOGE(FONT_COLOR_RED""fmt"", ##arg);     \
+                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
                        return; \
                } \
        } while (0)
 
 #define mc_retvm_if(expr, val, fmt, arg...) do { \
                if (expr) { \
-                       LOGE(FONT_COLOR_RED""fmt"", ##arg);     \
+                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
                        return (val); \
                } \
        } while (0)
old mode 100644 (file)
new mode 100755 (executable)
index ce92e55..2f4f3ac
@@ -1,6 +1,6 @@
 Name:       capi-media-controller
 Summary:    A media controller library in Tizen Native API
-Version:    0.1.27
+Version:    0.1.28
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 52f3560fba418b7ef2c4b0b65d43888023554e9f..817a77405e250576d72f98278293c40eb39d9c79 100755 (executable)
@@ -67,7 +67,7 @@ static void __client_playback_cb(const char *interface_name, const char *signal_
 
        callback(params[0], (mc_playback_h) playback, reciever->user_data);
 
-       MC_SAFE_FREE(playback);
+       mc_client_destroy_playback(playback);
 
        g_strfreev(params);
 }
old mode 100644 (file)
new mode 100755 (executable)
index 0220ef4..add1c66
@@ -151,27 +151,33 @@ static char* __mc_get_db_name(uid_t uid)
 {
        char result_psswd[MC_FILE_PATH_LEN_MAX] = {0, };
        char *result_psswd_rtn = NULL;
-       struct group *grpinfo = NULL;
        char * dir = NULL;
 
        memset(result_psswd, 0, sizeof(result_psswd));
 
-       struct passwd *userinfo = getpwuid(uid);
-       if (userinfo == NULL) {
-               mc_error("getpwuid(%d) returns NULL !", uid);
+       struct passwd pwd;
+       struct passwd *pwd_result = NULL;
+       char buf_pw[MC_FILE_PATH_LEN_MAX];
+       int ret = getpwuid_r(uid, &pwd, buf_pw, MC_FILE_PATH_LEN_MAX, &pwd_result);
+       if (ret != 0 || pwd_result == NULL) {
+               mc_error("getpwuid_r(%d) returns NULL !", uid);
                return NULL;
        }
-       grpinfo = getgrnam("users");
-       if (grpinfo == NULL) {
-               mc_error("getgrnam(users) returns NULL !");
+
+       struct group grp;
+       struct group *grp_result = NULL;
+       char buf_gr[MC_FILE_PATH_LEN_MAX];
+       ret = getgrnam_r("users", &grp, buf_gr, MC_FILE_PATH_LEN_MAX, &grp_result);
+       if (ret != 0 || grp_result == NULL) {
+               mc_error("getgrnam_r(users) returns NULL !");
                return NULL;
        }
        /* Compare git_t type and not group name */
-       if (grpinfo->gr_gid != userinfo->pw_gid) {
+       if (grp_result->gr_gid != pwd_result->pw_gid) {
                mc_error("UID [%d] does not belong to 'users' group!", uid);
                return NULL;
        }
-       snprintf(result_psswd, sizeof(result_psswd), "%s/.applications/dbspace/%s", userinfo->pw_dir, MC_DB_NAME);
+       snprintf(result_psswd, sizeof(result_psswd), "%s/.applications/dbspace/%s", pwd_result->pw_dir, MC_DB_NAME);
 
        dir = strrchr(result_psswd, '/');
        if (!dir)
old mode 100644 (file)
new mode 100755 (executable)
index 863e0bd..52f4393
@@ -14,9 +14,6 @@
 * limitations under the License.
 */
 
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <systemd/sd-daemon.h>