core: Use GFile for repo constructor API, and a bit more internally
Also, ensure that the repo directory GFile is absolute - this avoids a getcwd() syscall every time we construct a GFile object.
This commit is contained in:
1 parent
8a499c4a2a
commit
d25f1bf73d
21 files changed
+84
-85
No files matched your search
@@ -253,11 +253,11 @@ on_name_acquired (GDBusConnection *connection,
|
||||
{
|
||||
OstreeDaemon *self = user_data;
|
||||
GError *error = NULL;
|
||||
char *repo_path;
|
||||
GFile *repo_file = NULL;
|
||||
|
||||
repo_path = g_build_filename (ot_gfile_get_path_cached (self->prefix), "repo", NULL);
|
||||
self->repo = ostree_repo_new (repo_path);
|
||||
g_free (repo_path);
|
||||
repo_file = g_file_get_child (self->prefix, "repo");
|
||||
self->repo = ostree_repo_new (repo_file);
|
||||
g_clear_object (&repo_file);
|
||||
if (!ostree_repo_check (self->repo, &error))
|
||||
{
|
||||
g_printerr ("%s\n", error->message);
|
||||
|
||||
Reference in new issue
Block a user