summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2013-10-07 23:40:25 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2013-10-07 23:40:50 +0100
commit4752753fafe02bb96d42ddac11f928a3e2400a7c (patch)
tree968bda41a523de1b3207d74ea8864da2326221e2
parent05b4851da8aa1701795bb9665116313a5a0c49a7 (diff)
Fixes after code review
[endlessm/eos-sdk#326]
-rw-r--r--endless/endless.h2
-rw-r--r--endless/eosinit.c16
2 files changed, 11 insertions, 7 deletions
diff --git a/endless/endless.h b/endless/endless.h
index 3398b4d..9efbe6e 100644
--- a/endless/endless.h
+++ b/endless/endless.h
@@ -26,7 +26,7 @@ gboolean eos_hello_sample_function (GFile *file,
GError **error);
EOS_SDK_ALL_API_VERSIONS
-const char * eos_get_system_personality (void);
+const gchar * eos_get_system_personality (void);
G_END_DECLS
diff --git a/endless/eosinit.c b/endless/eosinit.c
index 057e391..f285da7 100644
--- a/endless/eosinit.c
+++ b/endless/eosinit.c
@@ -21,8 +21,6 @@ should also work on Clang. */
static gboolean _eos_initialized = FALSE;
-static char *eos_system_personality;
-
/*
* _eos_init:
*
@@ -67,17 +65,23 @@ eos_is_inited (void)
* with the name of the personality. You should never free or modify
* the returned string.
*/
-const char *
+const gchar *
eos_get_system_personality (void)
{
- static char *personality;
+ static gchar *personality;
if (g_once_init_enter (&personality))
{
- char *tmp;
+ gchar *tmp;
tmp = g_strdup (g_getenv ("ENDLESS_OS_PERSONALITY"));
- if (tmp == NULL || *tmp == '\0')
+ if (tmp == '\0')
+ {
+ g_free (tmp);
+ tmp = NULL;
+ }
+
+ if (tmp == NULL)
{
char *path = g_build_filename (DATADIR,
"EndlessOS",