diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2014-03-12 09:28:43 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2014-03-12 09:28:43 +1300 |
commit | 34129d2017f3b2dbbd58a4da3f101aa1934be622 (patch) | |
tree | 8e57aa6a84ddeb19eb74080db74e8f93edf6c898 /src | |
parent | 27d1cf1bfe2481094634326215bf3767d8c51f3c (diff) | |
download | lightdm-34129d2017f3b2dbbd58a4da3f101aa1934be622.tar.gz |
Don't use g_hash_table_get_keys_as_array, it's a glib 2.40 feature
Diffstat (limited to 'src')
-rw-r--r-- | src/process.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c index 71a4d77f..48811de1 100644 --- a/src/process.c +++ b/src/process.c @@ -177,6 +177,7 @@ process_start (Process *process, gboolean block) gchar **argv; gchar **env_keys, **env_values; guint i, env_length; + GList *link; pid_t pid; int log_fd = -1; GError *error = NULL; @@ -207,10 +208,14 @@ process_start (Process *process, gboolean block) } /* Work out variables to set */ - env_keys = (gchar **) g_hash_table_get_keys_as_array (process->priv->env, &env_length); + env_length = g_hash_table_size (process->priv->env); + env_keys = g_malloc (sizeof (gchar *) * env_length); env_values = g_malloc (sizeof (gchar *) * env_length); - for (i = 0; i < env_length; i++) + for (i = 0, link = g_hash_table_get_keys (process->priv->env); i < env_length; i++, link = link->next) + { + env_keys[i] = link->data; env_values[i] = g_hash_table_lookup (process->priv->env, env_keys[i]); + } pid = fork (); if (pid == 0) |