From bbf774cdfe6796a2d40ee35a96bfbea9c9b18ff0 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Tue, 27 Jul 2021 17:00:29 -0500 Subject: [PATCH] Fix build with glibc 2.34 Resolves: #1984626 --- 2180.patch | 29 +++++++++++++++++++++++++++++ glib2.spec | 9 ++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 2180.patch diff --git a/2180.patch b/2180.patch new file mode 100644 index 0000000..9f58768 --- /dev/null +++ b/2180.patch @@ -0,0 +1,29 @@ +From 891319de22c1b173afab8adaf20a01df68f11d61 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 8 Jul 2021 17:26:43 -0700 +Subject: [PATCH] correctly use 3 parameters for close_range + +libc implementation has 3 parameter e.g. +https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2&format=html + +Signed-off-by: Khem Raj +--- + glib/gspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glib/gspawn.c b/glib/gspawn.c +index 95f5b868e..a15fb1ca1 100644 +--- a/glib/gspawn.c ++++ b/glib/gspawn.c +@@ -1494,7 +1494,7 @@ safe_closefrom (int lowfd) + * + * Handle ENOSYS in case it’s supported in libc but not the kernel; if so, + * fall back to safe_fdwalk(). */ +- if (close_range (lowfd, G_MAXUINT) != 0 && errno == ENOSYS) ++ if (close_range (lowfd, G_MAXUINT, 0) != 0 && errno == ENOSYS) + #endif /* HAVE_CLOSE_RANGE */ + (void) safe_fdwalk (close_func, GINT_TO_POINTER (lowfd)); + #endif +-- +2.31.1 + diff --git a/glib2.spec b/glib2.spec index d132014..3977264 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,6 +1,6 @@ Name: glib2 Version: 2.68.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library of handy utility functions License: LGPLv2+ @@ -17,6 +17,9 @@ Patch0: gnutls-hmac.patch # Proposed upstream at https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1596 Patch1: 1596.patch +# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2180 +Patch2: 2180.patch + BuildRequires: chrpath BuildRequires: gcc BuildRequires: gcc-c++ @@ -236,6 +239,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/installed-tests %changelog +* Tue Jul 27 2021 Michael Catanzaro - 2.68.3-3 +- Fix build with glibc 2.34 +- Resolves: #1984626 + * Thu Jul 01 2021 Michael Catanzaro - 2.68.3-2 - Refresh gnutls-hmac patchset to fix leaks in error path - Related: #1971823