From 7d163c81743a696291cf82fb34ed4bb6be2cb373 Mon Sep 17 00:00:00 2001 From: han_hui_hui Date: Thu, 16 Feb 2023 03:45:07 +0000 Subject: [PATCH] backport some patches from community --- ...ledescriptors-and-newly-created-ones.patch | 67 +++++++++++++++++++ ...iling-newline-in-fallback-log-hander.patch | 32 +++++++++ glib2.spec | 8 ++- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch create mode 100644 backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch diff --git a/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch b/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch new file mode 100644 index 0000000..28939fa --- /dev/null +++ b/backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch @@ -0,0 +1,67 @@ +From dad97d24d578dbefbebb41829b0ffb9e783cac7b Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 28 Oct 2022 11:21:04 -0400 +Subject: [PATCH] Revert "Handling collision between standard i/o file + descriptors and newly created ones" + +g_unix_open_pipe tries to avoid the standard io fd range +when getting pipe fds. This turns out to be a bad idea because +certain buggy programs rely on it using that range. + +This reverts commit d9ba6150909818beb05573f54f26232063492c5b + +Closes: #2795 +Reopens: #16 + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/dad97d24d578dbefbebb41829b0ffb9e783cac7b + +--- + glib/glib-unix.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/glib/glib-unix.c b/glib/glib-unix.c +index 4710c51168..bc152d7663 100644 +--- a/glib/glib-unix.c ++++ b/glib/glib-unix.c +@@ -108,17 +108,6 @@ g_unix_open_pipe (int *fds, + ecode = pipe2 (fds, pipe2_flags); + if (ecode == -1 && errno != ENOSYS) + return g_unix_set_error_from_errno (error, errno); +- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ +- else if (fds[0] < 3 || fds[1] < 3) +- { +- int old_fds[2] = { fds[0], fds[1] }; +- gboolean result = g_unix_open_pipe (fds, flags, error); +- close (old_fds[0]); +- close (old_fds[1]); +- +- if (!result) +- g_unix_set_error_from_errno (error, errno); +- } + else if (ecode == 0) + return TRUE; + /* Fall through on -ENOSYS, we must be running on an old kernel */ +@@ -127,19 +116,6 @@ g_unix_open_pipe (int *fds, + ecode = pipe (fds); + if (ecode == -1) + return g_unix_set_error_from_errno (error, errno); +- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */ +- else if (fds[0] < 3 || fds[1] < 3) +- { +- int old_fds[2] = { fds[0], fds[1] }; +- gboolean result = g_unix_open_pipe (fds, flags, error); +- close (old_fds[0]); +- close (old_fds[1]); +- +- if (!result) +- g_unix_set_error_from_errno (error, errno); +- +- return result; +- } + + if (flags == 0) + return TRUE; +-- +GitLab + diff --git a/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch b/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch new file mode 100644 index 0000000..1067efc --- /dev/null +++ b/backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch @@ -0,0 +1,32 @@ +From d01fb412801ddc55843f1e1642d0fef0afba441a Mon Sep 17 00:00:00 2001 +From: John Lindgren +Date: Thu, 13 Oct 2022 14:00:12 +0100 +Subject: [PATCH] gmessages: Add missing trailing newline in fallback log + handler + +This makes the fallback log handler match the behaviour of the default +log handlers. + +Conflict:NA +Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/d01fb412801ddc55843f1e1642d0fef0afba441a + +Spotted as part of https://gitlab.gnome.org/GNOME/glib/-/issues/2753 +--- + glib/gmessages.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/glib/gmessages.c b/glib/gmessages.c +index fb1297f8a8..e197f1707a 100644 +--- a/glib/gmessages.c ++++ b/glib/gmessages.c +@@ -3159,6 +3159,7 @@ _g_log_fallback_handler (const gchar *log_domain, + write_string (stream, level_prefix); + write_string (stream, ": "); + write_string (stream, message); ++ write_string (stream, "\n"); + } + + static void +-- +GitLab + diff --git a/glib2.spec b/glib2.spec index 6e276a7..804f055 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,6 +1,6 @@ Name: glib2 Version: 2.68.1 -Release: 14 +Release: 15 Summary: The core library that forms the basis for projects such as GTK+ and GNOME License: LGPLv2+ URL: http://www.gtk.org @@ -62,6 +62,8 @@ Patch6052: backport-gdesktopappinfo-Unref-the-GDBus-call-results.patch Patch6053: backport-Handling-collision-between-standard-i-o-file-descriptors-and-newly-created-ones.patch Patch6054: backport-glocalfileoutputstream-Do-not-double-close-an-fd-on-unlink-error.patch Patch6055: backport-tests-Make-the-642026-test-take-100x-less-time.patch +Patch6056: backport-gmessages-Add-missing-trailing-newline-in-fallback-log-hander.patch +Patch6057: backport-Revert-Handling-collision-between-standard-i-o-filedescriptors-and-newly-created-ones.patch BuildRequires: chrpath gcc gcc-c++ gettext perl-interpreter BUildRequires: glibc-devel libattr-devel libselinux-devel meson @@ -227,6 +229,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %endif %changelog +* Thu Feb 16 2023 hanhuihui - 2.68.1-15 +- Type:bugfix +- DESC:backport some patches from community + * Wed Dec 14 2022 hanhuihui - 2.68.1-14 - Type:bugfix - DESC:fix failed tests -- Gitee