seoz pushed a commit to branch master.

commit 3c618e54a16e7c1c5f471f1f4528b57561259f46
Author: Daniel Juyung Seo <[email protected]>
Date:   Wed May 22 20:40:56 2013 +0900

    ecore_pipe.c: fixed fd handler increasing issue.
    
    Call _ecore_pipe_unhandle() when you return from _ecore_pipe_read() or the 
fd will never be closed.
    This fixed increasing numbers of fd handler issue when you call 
ecore_pipe_add/del repeatedly.
    In that case, reusing ecore_pipe is recommended though.
---
 ChangeLog                  | 4 ++++
 NEWS                       | 1 +
 src/lib/ecore/ecore_pipe.c | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 20a5f11..760271c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-22  Daniel Juyung Seo (SeoZ)
+
+        * Fix fd handler increase issue when ecore_pipe_add/del is called 
repeatedly.
+
 2013-05-22  ChunEon Park (Hermet)
 
         * Edje textblock: keep the text styles when new font by the text class 
is applied.
diff --git a/NEWS b/NEWS
index 899d3b2..e54766b 100644
--- a/NEWS
+++ b/NEWS
@@ -272,3 +272,4 @@ Fixes:
     * Ecore-imf: fix crash when ecore_imf_context_del is called in 
ecore_imf_context_input_panel_callback_call
     * Edje textblock: Fixed issue with quoted formats.
     * Edje textblock: Keep the text styles when new font by the text class is 
applied.
+    * Fix fd handler increase issue when ecore_pipe_add/del is called 
repeatedly.
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c
index 6e89fa8..705673b 100644
--- a/src/lib/ecore/ecore_pipe.c
+++ b/src/lib/ecore/ecore_pipe.c
@@ -656,6 +656,7 @@ _ecore_pipe_read(void             *data,
               else if ((ret == PIPE_FD_ERROR) &&
                        ((errno == EINTR) || (errno == EAGAIN)))
                 {
+                    _ecore_pipe_unhandle(p);
                    return ECORE_CALLBACK_RENEW;
                 }
               else
@@ -663,6 +664,7 @@ _ecore_pipe_read(void             *data,
                    ERR("An unhandled error (ret: %i errno: %i [%s])"
                        "occurred while reading from the pipe the length",
                        (int)ret, errno, strerror(errno));
+                    _ecore_pipe_unhandle(p);
                    return ECORE_CALLBACK_RENEW;
                 }
 #else

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to