[Xfce4-commits] [xfce/xfce4-session] 04/04: Check the return value of select

noreply at xfce.org noreply at xfce.org
Mon Sep 22 08:23:38 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-session.

commit 950ca44ff07af3c47cbdfde5333d05b3c8f509cd
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Tue Sep 16 20:40:16 2014 +0300

    Check the return value of select
---
 xfce4-session/xfsm-legacy.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/xfce4-session/xfsm-legacy.c b/xfce4-session/xfsm-legacy.c
index 7f29ea3..88c3ee0 100644
--- a/xfce4-session/xfsm-legacy.c
+++ b/xfce4-session/xfsm-legacy.c
@@ -442,6 +442,7 @@ xfsm_legacy_perform_session_save (void)
           fd_set fds;
           int msecs;
           int fd;
+          int ret;
 
           msecs = (int)(g_timer_elapsed (timer, NULL) * 1000);
           if (msecs >= WM_SAVE_YOURSELF_TIMEOUT)
@@ -452,7 +453,15 @@ xfsm_legacy_perform_session_save (void)
           FD_SET (fd, &fds);
           tv.tv_sec = (WM_SAVE_YOURSELF_TIMEOUT - msecs) / 1000;
           tv.tv_usec = ((WM_SAVE_YOURSELF_TIMEOUT - msecs) % 1000) * 1000;
-          select (fd + 1, &fds, NULL, &fds, &tv);
+          ret = select (fd + 1, &fds, NULL, &fds, &tv);
+          if (ret == -1)
+            {
+              perror ("select");
+            }
+          else if (ret == 0)
+            {
+              g_warning ("xfsm_legacy_perform_session_save, select: no data before timeout reached");
+            }
         }
     }
   g_timer_destroy (timer);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list