From 7ee718a4d7a79d3c62d2f84b97c24f8780d3d7e9 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Tue, 13 Oct 2015 15:02:21 +0900 Subject: remove getpwuid function of excetpion handling Change-Id: Iac0a3004f81393ede7ec5c4e3a985b38ebb68cd9 Signed-off-by: Soohye Shin --- src/data/data_home.c | 4 ---- src/data/data_user.c | 16 ++++------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/data/data_home.c b/src/data/data_home.c index f0cc1d6..4c22cb3 100644 --- a/src/data/data_home.c +++ b/src/data/data_home.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #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; } diff --git a/src/data/data_user.c b/src/data/data_user.c index 140ba52..1461ce0 100644 --- a/src/data/data_user.c +++ b/src/data/data_user.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #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"); -- cgit v1.2.3