File gnome-session-error-numbers-wrong.patch of Package gnome-session

From 534850d20b4f9dcb2c521bf6420a4d34123e7893 Mon Sep 17 00:00:00 2001
From: Xiaoguang Wang <xwang@suse.com>
Date: Fri, 10 Apr 2020 15:41:23 +0800
Subject: [PATCH] Valid error numbers are all positive numbers

There is error in journal log:
gnome-session-c[4905]: Error creating FIFO: File exists
The errno can't be negative number.

https://gitlab.gnome.org/GNOME/gnome-session/-/merge_requests/42
---
 gnome-session/main.c      | 2 +-
 tools/gnome-session-ctl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnome-session/main.c b/gnome-session/main.c
index 01f56667..c1dda5dc 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -349,7 +349,7 @@ systemd_leader_run(void)
         fifo_name = g_strdup_printf ("%s/gnome-session-leader-fifo",
                                      g_get_user_runtime_dir ());
         res = mkfifo (fifo_name, 0666);
-        if (res < 0 && errno != -EEXIST)
+        if (res < 0 && errno != EEXIST)
                 g_warning ("Error creating FIFO: %m");
 
         fifo_fd = g_open (fifo_name, O_WRONLY | O_CLOEXEC, 0666);
diff --git a/tools/gnome-session-ctl.c b/tools/gnome-session-ctl.c
index 9276a0ad..86f03be1 100644
--- a/tools/gnome-session-ctl.c
+++ b/tools/gnome-session-ctl.c
@@ -194,7 +194,7 @@ do_monitor_leader (void)
         fifo_name = g_strdup_printf ("%s/gnome-session-leader-fifo",
                                      g_get_user_runtime_dir ());
         res = mkfifo (fifo_name, 0666);
-        if (res < 0 && errno != -EEXIST)
+        if (res < 0 && errno != EEXIST)
                 g_warning ("Error creating FIFO: %m");
 
         data.fifo_fd = g_open (fifo_name, O_RDONLY | O_CLOEXEC, 0666);
-- 
2.26.0