Skip to content

Commit

Permalink
gnome-base/gnome-settings-daemon: fix build with glib-2.58
Browse files Browse the repository at this point in the history
New glib does typeof() checking on g_clear_pointer macro calls,
which fails with code that passed something unsuitable as
g_clear_pointer destroy parameter. notify_notification_close
takes a second parameter, which is not a valid function signature
for g_clear_pointer, thus it errors now. Add upstream patch to
fix that.

Because in practice the destroy func call worked out fine with
earlier glib, without any known problems, there is no revbump by
considering it only a build fix (which strictly it's not).

Closes: https://bugs.gentoo.org/673706
Signed-off-by: Mart Raudsepp <[email protected]>
Package-Manager: Portage-2.3.52, Repoman-2.3.11
  • Loading branch information
leio committed Dec 25, 2018
1 parent 31f18ec commit 8403a13
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
33 changes: 33 additions & 0 deletions gnome-base/gnome-settings-daemon/files/glib-2.58-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 3110457f72f70b2d283c1ad2f27b91b95d75d92f Mon Sep 17 00:00:00 2001
From: Christian Hergert <[email protected]>
Date: Wed, 18 Jul 2018 19:31:17 -0700
Subject: [PATCH] housekeeping: fix improper notify_notification_close() usage

notify_notification_close() expects that a parameter will be available for
the error location, which could be a dangling pointer in a register or
on the stack in the case of some architectures.

This was caught by GNOME/glib#1425 which allows us to check proper type
parameters.
---
plugins/housekeeping/gsd-disk-space.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 0ae40193..0eee94ea 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -1017,7 +1017,9 @@ gsd_ldsm_clean (void)
g_clear_object (&ldsm_monitor);
g_clear_object (&settings);
g_clear_object (&privacy_settings);
- g_clear_pointer (&notification, notify_notification_close);
+ /* NotifyNotification::closed callback will drop reference */
+ if (notification != NULL)
+ notify_notification_close (notification, NULL);
g_slist_free_full (ignore_paths, g_free);
ignore_paths = NULL;
}
--
2.17.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
Expand Down Expand Up @@ -103,6 +103,7 @@ PATCHES=(
# Reduce memory usage by using a fake CSS theme instead of full Adwaita for GTK+ needing plugins; requires eautoreconf
# Fix build system to require gudev with wayland, bug #627966
"${WORKDIR}"/patches/
"${FILESDIR}"/glib-2.58-compat.patch
)

python_check_deps() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ PATCHES=(
# Allow specifying udevrulesdir via configure, bug 509484; requires eautoreconf
# Fix build system to require gudev with wayland, bug #627966; requires eautoreconf
"${WORKDIR}"/patches/
"${FILESDIR}"/glib-2.58-compat.patch # included in 3.29.1+, might be backported to 3.28 too
)

python_check_deps() {
Expand Down

0 comments on commit 8403a13

Please sign in to comment.