Hi Tomas,

> 'hear' in the following snippet seems to block the whole process:
>    ...
>    (hear (mailbox I))

It looks like you found a bug in 'hear'!

It works, when you call

    (hear (open (mailbox I)))

i.e. when you pass a file descriptor instead of a file name.

I used 'hear' until now only in combination with 'open' (e.g. in
"lib/boss.l"), that's why I never noticed the problem ;-)

If you pass a file name to 'hear', it open()s it in O_RDONLY mode,
causing open() to block on that fifo until data are available. This is
not the expected behavior for 'hear'.

Thus, the right way would be that 'hear' either uses O_RDWR, or perhaps
better O_NONBLOCK. There is a discussion about than in the manpage
fifo(7).

I think I should change doHear(), to open() with O_NONBLOCK, and then
immediately call blocking(YES, ex, fd). What do you think?

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to