From: Christophe CURIS <christophe.cu...@free.fr>

As pointed by Coverity, the function GetCommandForPid did use a macro
'RETRY' for the 'close' of file descriptor, which is not correct because
on success the function 'close' does not reset errno, and in case of
failure the file descriptor is not more valid anyway.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 src/osdep_linux.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/osdep_linux.c b/src/osdep_linux.c
index 6d246e5..bb1ef2e 100644
--- a/src/osdep_linux.c
+++ b/src/osdep_linux.c
@@ -15,10 +15,6 @@
 #include "osdep.h"
 
 
-#define        RETRY( x )      do {                            \
-                               x;                      \
-                       } while (errno == EINTR);
-
 /*
  * copy argc and argv for an existing process identified by `pid'
  * into suitable storage given in ***argv and *argc.
@@ -54,10 +50,10 @@ Bool GetCommandForPid(int pid, char ***argv, int *argc)
                        break;
                if (errno == EINTR)
                        continue;
-               RETRY( close(fd) )
+               close(fd);
                return False;
        }
-       RETRY( close(fd) )
+       close(fd);
 
        /* count args */
        for (i = 0; i < count; i++)
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to