<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:37, Lex Trotman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On 21 May 2010 19:30, 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: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;"><br><div><div class="im"><div>On 21 mei 2010, at 11:07, Lex Trotman wrote:</div><br></div><blockquote type="cite"><br><br><div class="gmail_quote"><div class="im">On 21 May 2010 16:55, Andrei Vishneuski <span dir="ltr"><<a href="mailto:vish@gravitysoft.org" target="_blank">vish@gravitysoft.org</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  
  

<div text="#000000" bgcolor="#ffffff"><div><div></div><div><div class="im">
On 05/21/2010 02:06 AM, Lex Trotman wrote:
</div><blockquote type="cite"><br>
  <br>
  <div class="gmail_quote"><div class="im">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><div class="im"><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></div>
</blockquote>
<br></div></div><div class="im">
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></div></blockquote><div class="im"><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: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div text="#000000" bgcolor="#ffffff"><font color="#000000"><font color="#144fae"><br></font></font></div></blockquote></div></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></blockquote><div><br>Ok, good luck!!<br><br></div></div></blockquote></div><br><div>I have tried your solution. It works. "g_io_channel_read_line" method returns G_IO_STATUS_EOF as status what can be successfully used as condition to leave </div><div>watcher function.</div><div><br></div><div>Thank you !</div></body></html>