use getuid() to get key 83/47783/4
authorGukhwan Cho <gh78.cho@samsung.com>
Sat, 5 Sep 2015 05:02:43 +0000 (14:02 +0900)
committerjeesun kim <iamjs.kim@samsung.com>
Wed, 9 Sep 2015 03:09:29 +0000 (20:09 -0700)
Change-Id: Ife5b55855b40ca841673589951088a1212369fdf
Signed-off-by: Gukhwan Cho <gh78.cho@samsung.com>
client/cal_client_handle.c

index dc880b9..3f8c24b 100644 (file)
@@ -33,15 +33,9 @@ static GHashTable *_cal_handle_table = NULL;
 
 static int _cal_client_handle_get_key(unsigned int id, char *key, int key_len)
 {
-       int ret = 0;
-
        RETV_IF(NULL == key, CALENDAR_ERROR_INVALID_PARAMETER);
 
-       ret = gethostname(key, key_len);
-       RETVM_IF(0 != ret, CALENDAR_ERROR_SYSTEM, "gethostname() Fail(%d)", ret);
-
-       int len = strlen(key);
-       snprintf(key +len, key_len -len, ":%u", id);
+       snprintf(key, key_len, "%d:%u", getuid(), id);
        DBG("[%s]", key);
        return CALENDAR_ERROR_NONE;
 }