diff options
author | Xiaoguang Wang <xwang@suse.com> | 2020-04-10 15:41:23 +0800 |
---|---|---|
committer | Xiaoguang Wang <xwang@suse.com> | 2020-04-10 15:41:23 +0800 |
commit | 534850d20b4f9dcb2c521bf6420a4d34123e7893 (patch) | |
tree | f68c351e686482cf9b901ad3504c7cf3358960b4 | |
parent | 75b0bf5d38aa4d2aee4902f92d336b8ffefc091c (diff) | |
download | gnome-session-534850d20b4f9dcb2c521bf6420a4d34123e7893.tar.gz |
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
-rw-r--r-- | gnome-session/main.c | 2 | ||||
-rw-r--r-- | 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); |