[arch-commits] Commit in colord/trunk (2 files)

Jan Steffens heftig at archlinux.org
Wed Apr 17 14:46:41 UTC 2019


    Date: Wednesday, April 17, 2019 @ 14:46:41
  Author: heftig
Revision: 350838

1.4.4-2: Fix FS#37014

Added:
  colord/trunk/0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch
Modified:
  colord/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch |   41 ++++++++++
 PKGBUILD                                                        |   11 +-
 2 files changed, 49 insertions(+), 3 deletions(-)

Added: 0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch
===================================================================
--- 0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch	                        (rev 0)
+++ 0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch	2019-04-17 14:46:41 UTC (rev 350838)
@@ -0,0 +1,41 @@
+From 072d27fa368246a9c2bfbd8ba9f9c662ecda0b88 Mon Sep 17 00:00:00 2001
+Message-Id: <072d27fa368246a9c2bfbd8ba9f9c662ecda0b88.1555511658.git.jan.steffens at gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Wed, 17 Apr 2019 16:29:57 +0200
+Subject: [PATCH] trivial: Fix error checking for sd_pid_get_session and
+ sd_session_get_seat
+
+These functions can return a positive integer on success. Fix the
+conditions to only regard negative return values as errors.
+
+Fixes commit 6ffe2f6aae4bdc8331cab1fd9379ed8aef759749.
+Fixes https://bugs.archlinux.org/task/37014
+---
+ src/cd-main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cd-main.c b/src/cd-main.c
+index 514ae5c..ffcecb8 100644
+--- a/src/cd-main.c
++++ b/src/cd-main.c
+@@ -491,15 +491,15 @@ cd_main_get_seat_for_process (guint pid)
+ 
+ 	/* get session the process belongs to */
+ 	rc = sd_pid_get_session (pid, &sd_session);
+-	if (rc != 0) {
++	if (rc < 0) {
+ 		g_warning ("failed to get session [pid %u]: %s",
+ 			   pid, strerror (-rc));
+ 		goto out;
+ 	}
+ 
+ 	/* get the seat the session is on */
+ 	rc = sd_session_get_seat (sd_session, &sd_seat);
+-	if (rc != 0) {
++	if (rc < 0) {
+ 		g_warning ("failed to get seat for session %s [pid %u]: %s",
+ 			   sd_session, pid, strerror (-rc));
+ 		goto out;
+-- 
+2.21.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-04-17 11:45:50 UTC (rev 350837)
+++ PKGBUILD	2019-04-17 14:46:41 UTC (rev 350838)
@@ -4,7 +4,7 @@
 pkgbase=colord
 pkgname=(colord colord-sane)
 pkgver=1.4.4
-pkgrel=1
+pkgrel=2
 pkgdesc="System daemon for managing color devices"
 url="https://www.freedesktop.org/software/colord"
 arch=(x86_64)
@@ -14,8 +14,10 @@
              docbook-xsl)
 options=(!emptydirs)
 _commit=233e642f730e46e026c1fe45d36ea298de1e00fe  # tags/1.4.4^0
-source=("git+https://github.com/hughsie/colord#commit=$_commit")
-sha256sums=('SKIP')
+source=("git+https://github.com/hughsie/colord#commit=$_commit"
+        0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch)
+sha256sums=('SKIP'
+            '90df20f7962a24a97b92fcaa7178c263f4b00ba1e90ff2dc5efdb7e97873b3a1')
 validpgpkeys=('163EB50119225DB3DF8F49EA17ACBA8DFA970E17')  # Richard Hughes
 
 pkgver() {
@@ -25,6 +27,9 @@
 
 prepare() {
   cd colord
+
+  # https://bugs.archlinux.org/task/37014
+  patch -Np1 -i ../0001-trivial-Fix-error-checking-for-sd_pid_get_session-an.patch
 }
 
 build() {


More information about the arch-commits mailing list