<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 21 mei 2010, at 11:07, Lex Trotman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On 21 May 2010 16:55, Andrei Vishneuski <span dir="ltr"><<a href="mailto:vish@gravitysoft.org">vish@gravitysoft.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; ">



  
  

<div text="#000000" bgcolor="#ffffff"><div><div></div><div class="h5">
On 05/21/2010 02:06 AM, Lex Trotman wrote:
<blockquote type="cite"><br>
  <br>
  <div class="gmail_quote">On 21 May 2010 02:49, Andrei Vishneuski <span dir="ltr"><<a href="mailto:vish@gravitysoft.org" target="_blank">vish@gravitysoft.org</a>></span>
wrote:<br>
  
  <div>Ok, thats where I thought it would be, I'm not sure why, maybe
its GTK2.18 or OSX pipes but whatever, can you try the attached patch
that tries to pick up more conditions to stop.</div>
  </div>
</blockquote>
<br></div></div>
Debugging indicated that the section below starts getting condition =
G_IO_IN forever, but  "g_io_channel_read_line" can read nothing.<br>
I have tried to use additional reading method like read_char,
read_to_the_end. I have tried to flush pipe. None of it helped.<br>
The result workaround I have used shown below: <br>
<br>
<pre>if (cond & (G_IO_IN | G_IO_PRI))
        {
                gchar *msg;
+               int count = 0;
 
                while (g_io_channel_read_line(ioc, &msg, NULL, NULL, NULL) && msg)
                {
                        gint color = (GPOINTER_TO_INT(data)) ? COLOR_DARK_RED : COLOR_BLACK;
 
                        process_build_output_line(msg, color);
                        g_free(msg);
+                       count++
                }

+               if (count == 0) return FALSE;
        }
</pre>
<br>
It works, but doesn't give an answer why pipe says "there is still
something to read in the pipe".<br>
<br>
<br></div></blockquote><div><br>Hmmmmm....<br><br>Did you have a chance to test the patch that checks the return from g_io_channel_read_line?<br><br>Cheers<br>Lex <br></div><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; ">
<div text="#000000" bgcolor="#ffffff"><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote></div></blockquote><br></div><div>No I have not tried it yet (read it this morning). I will try it today to see may be G_IO_STATUS_ xXX </div><div>can be used as an indicator to compete pipe input  handling.  </div><div><br></div><div><br></div><div><br></div></body></html>