summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-07-31 16:58:19 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-08-03 12:27:21 +0900
commit868d0fb2e8a8392f3e5593ac1e24bc840affb3d2 (patch)
tree5f874012487c654e01ea46bdc16f93c0fd2a5fca
parent7bfecbdaf2a9cf4ebc73fc35d459ab549bd56313 (diff)
ecore_pipe: Fix potential double close
p->fd_read can be closed in _ecore_pipe_read (from a previous loop) CID 1267459
-rw-r--r--src/lib/ecore/ecore_pipe.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c
index 823f07dc23..35f921f3fa 100644
--- a/src/lib/ecore/ecore_pipe.c
+++ b/src/lib/ecore/ecore_pipe.c
@@ -487,8 +487,11 @@ _ecore_pipe_wait(Ecore_Pipe *p,
487 } 487 }
488 else if (errno != EINTR) 488 else if (errno != EINTR)
489 { 489 {
490 close(p->fd_read); 490 if (p->fd_read != PIPE_FD_INVALID)
491 p->fd_read = PIPE_FD_INVALID; 491 {
492 close(p->fd_read);
493 p->fd_read = PIPE_FD_INVALID;
494 }
492 break; 495 break;
493 } 496 }
494 497