Skip to content
Snippets Groups Projects
Commit 087f1fb4 authored by Simon McVittie's avatar Simon McVittie
Browse files

Further reduce diff between Flatpak 1.6.1 and our Flatpak-derived code

parent 56441b96
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@ void flatpak_bwrap_add_noinherit_fd (FlatpakBwrap *bwrap,
void flatpak_bwrap_add_fd (FlatpakBwrap *bwrap,
int fd);
void flatpak_bwrap_add_args (FlatpakBwrap *bwrap,
...);
...) G_GNUC_NULL_TERMINATED;
void flatpak_bwrap_add_arg_printf (FlatpakBwrap *bwrap,
const char *format,
...) G_GNUC_PRINTF (2, 3);
......@@ -80,7 +80,8 @@ gboolean flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap,
GError **error);
void flatpak_bwrap_child_setup_cb (gpointer user_data);
void flatpak_bwrap_child_setup (GArray *fd_array,
gboolean close_fd_workaround);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakBwrap, flatpak_bwrap_free)
......
......@@ -34,8 +34,8 @@
#include "libglnx/libglnx.h"
#include "flatpak-bwrap-private.h"
#include "flatpak-utils-base-private.h"
#include "flatpak-utils-private.h"
#include "flatpak-utils-base-private.h"
#include "glib-backports.h"
......@@ -323,13 +323,15 @@ flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap,
return TRUE;
}
/* Unset FD_CLOEXEC on the array of fds passed in @user_data */
void
flatpak_bwrap_child_setup_cb (gpointer user_data)
flatpak_bwrap_child_setup (GArray *fd_array,
gboolean close_fd_workaround)
{
GArray *fd_array = user_data;
int i;
if (close_fd_workaround)
flatpak_close_fds_workaround (3);
/* If no fd_array was specified, don't care. */
if (fd_array == NULL)
return;
......@@ -349,3 +351,12 @@ flatpak_bwrap_child_setup_cb (gpointer user_data)
fcntl (fd, F_SETFD, 0);
}
}
/* Unset FD_CLOEXEC on the array of fds passed in @user_data */
void
flatpak_bwrap_child_setup_cb (gpointer user_data)
{
GArray *fd_array = user_data;
flatpak_bwrap_child_setup (fd_array, TRUE);
}
......@@ -6,21 +6,25 @@
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* This library is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Alexander Larsson <alexl@redhat.com>
*/
#pragma once
#ifndef __FLATPAK_RUN_H__
#define __FLATPAK_RUN_H__
#include <glib.h>
#include <glib-object.h>
......@@ -28,6 +32,7 @@
#include "libglnx/libglnx.h"
#include "flatpak-bwrap-private.h"
#include "flatpak-utils-private.h"
#include "glib-backports.h"
void flatpak_run_add_x11_args (FlatpakBwrap *bwrap,
......@@ -36,3 +41,4 @@ gboolean flatpak_run_add_wayland_args (FlatpakBwrap *bwrap);
void flatpak_run_add_pulseaudio_args (FlatpakBwrap *bwrap);
gboolean flatpak_run_add_system_dbus_args (FlatpakBwrap *app_bwrap);
gboolean flatpak_run_add_session_dbus_args (FlatpakBwrap *app_bwrap);
#endif /* __FLATPAK_RUN_H__ */
......@@ -6,18 +6,21 @@
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* This library is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Alexander Larsson <alexl@redhat.com>
*/
#include "flatpak-run-private.h"
......@@ -26,6 +29,7 @@
#include <X11/Xauth.h>
#include <gio/gio.h>
#include "libglnx/libglnx.h"
#include "flatpak-utils-base-private.h"
#include "flatpak-utils-private.h"
......@@ -126,7 +130,7 @@ write_xauth (char *number, FILE *output)
fclose (f);
}
#endif
#endif /* ENABLE_XAUTH */
void
flatpak_run_add_x11_args (FlatpakBwrap *bwrap,
......
......@@ -20,8 +20,6 @@
* Alexander Larsson <alexl@redhat.com>
*/
#include "flatpak-utils-private.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
......@@ -39,6 +37,7 @@
#include <glib.h>
#include "flatpak-utils-base-private.h"
#include "flatpak-utils-private.h"
/* To keep this more similar to the original file, we explicitly disable
* this warning rather than fixing it */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment