using peek() instead of read(0,1) in __stdio_close_callback() and adding
}else if (fds.revents & (POLLERR | POLLHUP)){ ret=0;
to file_peek() fixed this issue for me.
Thanks for the suggestion. I've now added a second optional argument to peek() to specify a behaviour similar to the above.
The same problem may occur when using select() in file_peek(), I did not test that though.
Probably. I haven't tested either.
arne