Commit 401d710a authored by David Zeuthen's avatar David Zeuthen
Browse files

Bug 27081 – pkexec fails to build on non glibc systems

https://bugs.freedesktop.org/show_bug.cgi?id=27081

Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 986d7c29
......@@ -47,7 +47,7 @@
#include <polkitagent/polkitagent.h>
static gchar *original_user_name = NULL;
static gchar *original_cwd = NULL;
static gchar original_cwd[PATH_MAX];
static gchar *command_line = NULL;
static struct passwd *pw;
......@@ -450,10 +450,10 @@ main (int argc, char *argv[])
goto out;
}
original_cwd = g_strdup (get_current_dir_name ());
if (original_cwd == NULL)
if (getcwd (original_cwd, sizeof (original_cwd)) == NULL)
{
g_printerr ("Error getting cwd.\n");
g_printerr ("Error getting cwd: %s\n",
g_strerror (errno));
goto out;
}
......@@ -884,7 +884,6 @@ main (int argc, char *argv[])
g_free (command_line);
g_free (opt_user);
g_free (original_user_name);
g_free (original_cwd);
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment