summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoohye Shin <soohye.shin@samsung.com>2015-10-13 15:02:21 +0900
committerSoohye Shin <soohye.shin@samsung.com>2015-10-13 16:08:31 +0900
commit7ee718a4d7a79d3c62d2f84b97c24f8780d3d7e9 (patch)
tree2bfa51a1338e25322db04dcbfdd188e4218baeb6
parent663ec8fdd347367c7dae6b08c06539879589985a (diff)
downloadair_home-7ee718a4d7a79d3c62d2f84b97c24f8780d3d7e9.tar.gz
air_home-7ee718a4d7a79d3c62d2f84b97c24f8780d3d7e9.tar.bz2
air_home-7ee718a4d7a79d3c62d2f84b97c24f8780d3d7e9.zip
remove getpwuid function of excetpion handling
Change-Id: Iac0a3004f81393ede7ec5c4e3a985b38ebb68cd9 Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
-rw-r--r--src/data/data_home.c4
-rw-r--r--src/data/data_user.c16
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 <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;
}
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 <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");