Use g_auto(GStrv) instead of gs_strfreev
This commit is contained in:
parent
cca69b3f55
commit
302ac4dd89
|
|
@ -296,7 +296,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
|
||||||
g_autoptr(GFile) new_config_path = NULL;
|
g_autoptr(GFile) new_config_path = NULL;
|
||||||
glnx_unref_object GSSubprocessContext *procctx = NULL;
|
glnx_unref_object GSSubprocessContext *procctx = NULL;
|
||||||
glnx_unref_object GSSubprocess *proc = NULL;
|
glnx_unref_object GSSubprocess *proc = NULL;
|
||||||
gs_strfreev char **child_env = g_get_environ ();
|
g_auto(GStrv) child_env = g_get_environ ();
|
||||||
g_autofree char *bootversion_str = g_strdup_printf ("%u", (guint)bootversion);
|
g_autofree char *bootversion_str = g_strdup_printf ("%u", (guint)bootversion);
|
||||||
g_autoptr(GFile) config_path_efi_dir = NULL;
|
g_autoptr(GFile) config_path_efi_dir = NULL;
|
||||||
g_autofree char *grub2_mkconfig_chroot = NULL;
|
g_autofree char *grub2_mkconfig_chroot = NULL;
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ _ostree_kernel_args_append_proc_cmdline (OstreeKernelArgs *kargs,
|
||||||
g_autoptr(GFile) proc_cmdline_path = g_file_new_for_path ("/proc/cmdline");
|
g_autoptr(GFile) proc_cmdline_path = g_file_new_for_path ("/proc/cmdline");
|
||||||
g_autofree char *proc_cmdline = NULL;
|
g_autofree char *proc_cmdline = NULL;
|
||||||
gsize proc_cmdline_len = 0;
|
gsize proc_cmdline_len = 0;
|
||||||
gs_strfreev char **proc_cmdline_args = NULL;
|
g_auto(GStrv) proc_cmdline_args = NULL;
|
||||||
|
|
||||||
if (!g_file_load_contents (proc_cmdline_path, cancellable,
|
if (!g_file_load_contents (proc_cmdline_path, cancellable,
|
||||||
&proc_cmdline, &proc_cmdline_len,
|
&proc_cmdline, &proc_cmdline_len,
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ _ostree_repo_get_remote_list_option (OstreeRepo *self,
|
||||||
|
|
||||||
if (remote != NULL)
|
if (remote != NULL)
|
||||||
{
|
{
|
||||||
gs_strfreev char **value = NULL;
|
g_auto(GStrv) value = NULL;
|
||||||
GError *local_error = NULL;
|
GError *local_error = NULL;
|
||||||
|
|
||||||
value = g_key_file_get_string_list (remote->options,
|
value = g_key_file_get_string_list (remote->options,
|
||||||
|
|
@ -1272,7 +1272,7 @@ add_remotes_from_keyfile (OstreeRepo *self,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GQueue queue = G_QUEUE_INIT;
|
GQueue queue = G_QUEUE_INIT;
|
||||||
gs_strfreev char **groups = NULL;
|
g_auto(GStrv) groups = NULL;
|
||||||
gsize length, ii;
|
gsize length, ii;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ ot_keyfile_copy_group (GKeyFile *source_keyfile,
|
||||||
GKeyFile *target_keyfile,
|
GKeyFile *target_keyfile,
|
||||||
const char *group_name)
|
const char *group_name)
|
||||||
{
|
{
|
||||||
gs_strfreev char **keys = NULL;
|
g_auto(GStrv) keys = NULL;
|
||||||
gsize length, ii;
|
gsize length, ii;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
|
||||||
else if (merge_deployment)
|
else if (merge_deployment)
|
||||||
{
|
{
|
||||||
OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (merge_deployment);
|
OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (merge_deployment);
|
||||||
gs_strfreev char **previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", -1);
|
g_auto(GStrv) previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", -1);
|
||||||
|
|
||||||
_ostree_kernel_args_append_argv (kargs, previous_args);
|
_ostree_kernel_args_append_argv (kargs, previous_args);
|
||||||
}
|
}
|
||||||
|
|
@ -157,7 +157,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
gs_strfreev char **kargs_strv = _ostree_kernel_args_to_strv (kargs);
|
g_auto(GStrv) kargs_strv = _ostree_kernel_args_to_strv (kargs);
|
||||||
|
|
||||||
if (!ostree_sysroot_deploy_tree (sysroot,
|
if (!ostree_sysroot_deploy_tree (sysroot,
|
||||||
opt_osname, revision, origin,
|
opt_osname, revision, origin,
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
|
||||||
else if (opt_merge)
|
else if (opt_merge)
|
||||||
{
|
{
|
||||||
OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (first_deployment);
|
OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (first_deployment);
|
||||||
gs_strfreev char **previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", -1);
|
g_auto(GStrv) previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", -1);
|
||||||
|
|
||||||
_ostree_kernel_args_append_argv (kargs, previous_args);
|
_ostree_kernel_args_append_argv (kargs, previous_args);
|
||||||
}
|
}
|
||||||
|
|
@ -105,7 +105,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
|
||||||
_ostree_kernel_args_append (kargs, argv[i]);
|
_ostree_kernel_args_append (kargs, argv[i]);
|
||||||
|
|
||||||
{
|
{
|
||||||
gs_strfreev char **kargs_strv = _ostree_kernel_args_to_strv (kargs);
|
g_auto(GStrv) kargs_strv = _ostree_kernel_args_to_strv (kargs);
|
||||||
|
|
||||||
if (!ostree_sysroot_deployment_set_kargs (sysroot, first_deployment,
|
if (!ostree_sysroot_deployment_set_kargs (sysroot, first_deployment,
|
||||||
kargs_strv,
|
kargs_strv,
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,8 @@ test_get_value_with_default (void)
|
||||||
static void
|
static void
|
||||||
test_copy_group (void)
|
test_copy_group (void)
|
||||||
{
|
{
|
||||||
gs_strfreev char **keys = NULL;
|
g_auto(GStrv) keys = NULL;
|
||||||
gs_strfreev char **keys2 = NULL;
|
g_auto(GStrv) keys2 = NULL;
|
||||||
gsize length, length2, ii;
|
gsize length, length2, ii;
|
||||||
GKeyFile *tmp = g_key_file_new ();
|
GKeyFile *tmp = g_key_file_new ();
|
||||||
const char *section = "section";
|
const char *section = "section";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue