[Gambas-user] Application_Read() called with no end

Benoît Minisini gambas at ...1...
Mon Aug 19 23:46:51 CEST 2013


Le 18/08/2013 21:08, Tobias Boege a écrit :
> Hi Benoit,
>
> I'm using Application_Read() in a project now and it seems to misbehave. I
> have attached a project which mirrors its input from within
> Application_Read() using the Debug instruction.
>
> The problem is, even though the file I am redirecting in is completely read,
> Application_Read() is still called with no end:
>
> $ echo "abc" >/tmp/file
> $ gbx3 </tmp/file
> MMain.Application_Read.12: abc
> MMain.Application_Read.12:
> MMain.Application_Read.12:
> MMain.Application_Read.12:
> ^C
>
> Maybe there is some feof(stdin) check missing to stop the watch since to
> select(2), the file is still readily readable at the EOF. As callback_read()
> in gbx_c_file.c seems to be widely shared, I don't want to mess around with
> it without knowing the rest of the code.
>
> Regards,
> Tobi
>

Revision #5811 should fix that.

The principle is disabling the read watch as soon as reading a stream 
fails for any reason.

If anything goes wrong after this fix, you will have to wait for two 
weeks: I leave Paris for holidays!

Regards,

-- 
Benoît Minisini




More information about the User mailing list