From 401c276c6035784fdd5104b83a743baaec65f5a2 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Thu, 25 Sep 2014 20:18:35 +0300 Subject: Don't log errors when trying to close non-existant FDs This just keeps the .xsession-errors log file from having around a thousand error messages when gnome-compat tries to close file descriptors that never existed. Other error messages will still properly show. --- xfce4-session/xfsm-compat-gnome.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xfce4-session/xfsm-compat-gnome.c b/xfce4-session/xfsm-compat-gnome.c index 05bd9622..35e96175 100644 --- a/xfce4-session/xfsm-compat-gnome.c +++ b/xfce4-session/xfsm-compat-gnome.c @@ -83,7 +83,8 @@ child_setup (gpointer user_data) if (fd != keyring_lifetime_pipe[0]) { ret = fcntl (fd, F_SETFD, FD_CLOEXEC); - if (ret == -1) + /* We end up trying to close a lot of non-existant FDs here */ + if (ret == -1 && errno != EBADF) { perror ("child_setup: fcntl (fd, F_SETFD, FD_CLOEXEC) failed"); } -- cgit v1.2.1