New upstream version 2020.4

This commit is contained in:
Simon McVittie committed 2020-07-27 21:38:25 +01:00
commit 10a6e008df
129 files changed
+7441 -1244

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
libglnx is the successor to libgsystem: https://git.gnome.org/browse/libgsystem
libglnx is the successor to [libgsystem](https://gitlab.gnome.org/Archive/libgsystem).
It is for modules which depend on both GLib and Linux, intended to be
used as a git submodule.
+8
View File
@@ -49,7 +49,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContext, g_main_context_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainLoop, g_main_loop_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSource, g_source_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMappedFile, g_mapped_file_unref)
#if GLIB_CHECK_VERSION(2, 36, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMarkupParseContext, g_markup_parse_context_unref)
#endif
G_DEFINE_AUTOPTR_CLEANUP_FUNC(gchar, g_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNode, g_node_destroy)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionContext, g_option_context_free)
@@ -75,11 +77,15 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariant, g_variant_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantBuilder, g_variant_builder_unref)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantBuilder, g_variant_builder_clear)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantIter, g_variant_iter_free)
#if GLIB_CHECK_VERSION(2, 40, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
#endif
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
#if GLIB_CHECK_VERSION(2, 40, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocess, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocessLauncher, g_object_unref)
#endif
/* Add GObject-based types as needed. */
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncResult, g_object_unref)
@@ -101,7 +107,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMount, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOutputStream, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocket, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketAddress, g_object_unref)
#if GLIB_CHECK_VERSION(2, 36, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTask, g_object_unref)
#endif
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsCertificate, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsDatabase, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsInteraction, g_object_unref)
+32
View File
@@ -27,6 +27,26 @@
G_BEGIN_DECLS
#if !GLIB_CHECK_VERSION(2, 34, 0)
#define g_clear_pointer(pp, destroy) \
G_STMT_START { \
G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
/* Only one access, please; work around type aliasing */ \
union { char *in; gpointer *out; } _pp; \
gpointer _p; \
/* This assignment is needed to avoid a gcc warning */ \
GDestroyNotify _destroy = (GDestroyNotify) (destroy); \
\
_pp.in = (char *) (pp); \
_p = *_pp.out; \
if (_p) \
{ \
*_pp.out = NULL; \
_destroy (_p); \
} \
} G_STMT_END
#endif
#if !GLIB_CHECK_VERSION(2, 44, 0)
#define g_strv_contains glnx_strv_contains
@@ -43,4 +63,16 @@ gboolean glnx_set_object (GObject **object_ptr,
#endif /* !GLIB_CHECK_VERSION(2, 44, 0) */
#ifndef g_assert_nonnull
#define g_assert_nonnull(x) g_assert (x != NULL)
#endif
#ifndef g_assert_null
#define g_assert_null(x) g_assert (x == NULL)
#endif
#if !GLIB_CHECK_VERSION (2, 38, 0)
#define g_test_skip(s) g_test_message ("SKIP: %s", s)
#endif
G_END_DECLS
+3 -2
View File
@@ -37,6 +37,7 @@
#include <glnx-errors.h>
#include <glnx-xattrs.h>
#include <glnx-backport-autoptr.h>
#include <glnx-backports.h>
#include <glnx-local-alloc.h>
#include <glnx-missing.h>
@@ -825,7 +826,7 @@ glnx_regfile_copy_bytes (int fdf, int fdt, off_t max_bytes)
have_cfr = 0;
try_cfr = false;
}
else if (errno == EXDEV)
else if (G_IN_SET (errno, EXDEV, EOPNOTSUPP))
/* We won't try cfr again for this run, but let's be
* conservative and not mark it as available/unavailable until
* we know for sure.
@@ -938,7 +939,7 @@ glnx_regfile_copy_bytes (int fdf, int fdt, off_t max_bytes)
gboolean
glnx_file_copy_at (int src_dfd,
const char *src_subpath,
struct stat *src_stbuf,
const struct stat *src_stbuf,
int dest_dfd,
const char *dest_subpath,
GLnxFileCopyFlags copyflags,
+1 -1
View File
@@ -193,7 +193,7 @@ typedef enum {
gboolean
glnx_file_copy_at (int src_dfd,
const char *src_subpath,
struct stat *src_stbuf,
const struct stat *src_stbuf,
int dest_dfd,
const char *dest_subpath,
GLnxFileCopyFlags copyflags,
+2 -2
View File
@@ -25,10 +25,10 @@ AS_IF([test $enable_otmpfile = yes], [], [
AC_ARG_ENABLE(wrpseudo-compat,
[AS_HELP_STRING([--enable-wrpseudo-compat],
[Disable use syscall() and filesystem calls to for compatibility with wrpseudo [default=no]])],,
[Disable use of syscall() in some cases for compatibility with pseudo [default=no]])],,
[enable_wrpseudo_compat=no])
AS_IF([test $enable_wrpseudo_compat = no], [], [
AC_DEFINE([ENABLE_WRPSEUDO_COMPAT], 1, [Define if we should be compatible with wrpseudo])])
AC_DEFINE([ENABLE_WRPSEUDO_COMPAT], 1, [Define if we should be compatible with pseudo])])
dnl end LIBGLNX_CONFIGURE
])
+8
View File
@@ -23,6 +23,8 @@
#include <errno.h>
#include <glib/gstdio.h>
#include "libglnx.h"
struct _GLnxTestAutoTempDir
@@ -63,4 +65,10 @@ _glnx_test_auto_temp_dir_leave (_GLnxTestAutoTempDir *dir)
glnx_tmpdir_delete (&dir->temp_dir, NULL, &error);
g_assert_no_error (error);
g_close (dir->old_cwd_fd, &error);
g_assert_no_error (error);
g_free (dir->old_cwd);
g_free (dir);
}
+1 -1
View File
@@ -45,4 +45,4 @@ void _glnx_test_auto_temp_dir_leave (_GLnxTestAutoTempDir *dir);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(_GLnxTestAutoTempDir, _glnx_test_auto_temp_dir_leave);
#define _GLNX_TEST_SCOPED_TEMP_DIR \
g_autoptr(_GLnxTestAutoTempDir) temp_dir = _glnx_test_auto_temp_dir_enter ()
G_GNUC_UNUSED g_autoptr(_GLnxTestAutoTempDir) temp_dir = _glnx_test_auto_temp_dir_enter ()
+4
View File
@@ -218,7 +218,11 @@ test_xattr_races (void)
/* FIXME - this deadlocks for me on 4.9.4-201.fc25.x86_64, whether
* using overlayfs or xfs as source/dest.
*/
#if GLIB_CHECK_VERSION (2, 36, 0)
const guint nprocs = MAX (4, g_get_num_processors ());
#else
const guint nprocs = 4;
#endif
struct XattrWorker wdata[nprocs];
GThread *threads[nprocs];
g_autoptr(GError) local_error = NULL;