diff --git a/0001-linux-Correctly-close-inhibitor-FD.patch b/0001-linux-Correctly-close-inhibitor-FD.patch new file mode 100644 index 0000000..d1c37c1 --- /dev/null +++ b/0001-linux-Correctly-close-inhibitor-FD.patch @@ -0,0 +1,44 @@ +From 502c63b54944064dfd5f5cc4463bfb3d457a95c0 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Thu, 3 Aug 2017 17:12:50 +0200 +Subject: [PATCH] linux: Correctly close inhibitor FD + +The unref of the FD list for the inhibitor was missing which means that +the FD was leaked and the lock was never released. This means that for +each suspend/resume cycle a new inhibitor would be added. + +Signed-off-by: Richard Hughes +--- + src/linux/up-backend.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c +index c5f8fd9..e7684a2 100644 +--- a/src/linux/up-backend.c ++++ b/src/linux/up-backend.c +@@ -475,7 +475,7 @@ static void + up_backend_inhibitor_lock_take (UpBackend *backend) + { + GVariant *out, *input; +- GUnixFDList *fds; ++ GUnixFDList *fds = NULL; + GError *error = NULL; + + if (backend->priv->logind_inhibitor_fd > -1) { +@@ -505,11 +505,13 @@ up_backend_inhibitor_lock_take (UpBackend *backend) + if (g_unix_fd_list_get_length (fds) != 1) { + g_warning ("Unexpected values returned by logind's 'Inhibit'"); + g_variant_unref (out); ++ g_object_unref (fds); + return; + } + + backend->priv->logind_inhibitor_fd = g_unix_fd_list_get (fds, 0, NULL); + g_variant_unref (out); ++ g_object_unref (fds); + + g_debug ("Acquired inhibitor lock (%i)", backend->priv->logind_inhibitor_fd); + } +-- +2.13.5 + diff --git a/upower.spec b/upower.spec index ed05c9a..bae05c4 100644 --- a/upower.spec +++ b/upower.spec @@ -1,12 +1,14 @@ Summary: Power Management Service Name: upower Version: 0.99.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://upower.freedesktop.org/ Source0: http://upower.freedesktop.org/releases/upower-%{version}.tar.xz +Patch0: 0001-linux-Correctly-close-inhibitor-FD.patch + BuildRequires: sqlite-devel BuildRequires: libtool BuildRequires: intltool @@ -109,6 +111,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_datadir}/gtk-doc/html/UPower/* %changelog +* Thu Aug 24 2017 Benjamin Berg - 0.99.5-4 +- Add patch to not correctly close the inhibitor FD + * Thu Aug 03 2017 Fedora Release Engineering - 0.99.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild