remove getpwuid function of excetpion handling 21/49421/3
authorSoohye Shin <soohye.shin@samsung.com>
Tue, 13 Oct 2015 06:02:21 +0000 (15:02 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Tue, 13 Oct 2015 07:08:31 +0000 (16:08 +0900)
Change-Id: Iac0a3004f81393ede7ec5c4e3a985b38ebb68cd9
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
src/data/data_home.c
src/data/data_user.c

index f0cc1d6..4c22cb3 100644 (file)
@@ -22,7 +22,6 @@
 #include <viewmgr.h>
 #include <notification.h>
 #include <notification_internal.h>
-#include <pwd.h>
 #include <gum/gum-user.h>
 
 #include "data_home.h"
@@ -79,14 +78,11 @@ static inline gboolean _read_boolean(JsonReader *reader, char *member)
 static void _get_login_user(char **name, char **icon, char **focus_icon)
 {
        GumUser *user;
-       struct passwd *passwd;
        uid_t uid = getuid();
 
        user = gum_user_get_sync(uid, FALSE);
        if (!user) {
                _ERR("failed to get user service");
-               passwd = getpwuid(uid);
-               *name = passwd->pw_name;
                return;
        }
 
index 140ba52..1461ce0 100644 (file)
@@ -23,7 +23,6 @@
 #include <gum/gum-user.h>
 #include <gum/gum-user-service.h>
 #include <gum/common/gum-user-types.h>
-#include <pwd.h>
 #include <gio/gio.h>
 
 #include "data_user.h"
@@ -261,22 +260,13 @@ static bool _load_login_user(Eina_List **list)
        GumUser *user;
        uid_t uid;
        char *name, *icon;
-       struct passwd *passwd;
        GumUserType type;
 
        uid = getuid();
        user = gum_user_get_sync(uid, FALSE);
        if (!user) {
                _ERR("failed to get user service");
-               passwd = getpwuid(uid);
-               di = _pack_user(passwd->pw_name, IMAGE_USER_DEFAULT,
-                               IMAGE_USER_DEFAULT_FOCUS,
-                               ITEM_SELECT_ACTION_POP, NULL, 0);
-               if (!di)
-                       return false;
-
-               *list = eina_list_append(*list, di);
-               return true;
+               return false;
        }
 
        name = NULL;
@@ -407,8 +397,10 @@ static bool _load_add_user(Eina_List **list)
 
 static bool _load_user(struct datamgr *dm)
 {
-       if (!_load_login_user(&dm->list))
+       if (!_load_login_user(&dm->list)) {
                _ERR("failed to load login user");
+               return false;
+       }
 
        if (!_load_users(&dm->list))
                _ERR("failed to load users");