Fix EINTR handling in Unix stdin pipe hack
parent
e6282fe1a8
commit
0f6ecc10cd
|
@ -168,7 +168,7 @@ M: stdin dispose
|
||||||
|
|
||||||
: wait-for-stdin ( stdin -- n )
|
: wait-for-stdin ( stdin -- n )
|
||||||
[ control>> CHAR: X over io:stream-write1 io:stream-flush ]
|
[ control>> CHAR: X over io:stream-write1 io:stream-flush ]
|
||||||
[ size>> "size_t" heap-size swap io:stream-read *uint ]
|
[ size>> "ssize_t" heap-size swap io:stream-read *int ]
|
||||||
bi ;
|
bi ;
|
||||||
|
|
||||||
:: refill-stdin ( buffer stdin size -- )
|
:: refill-stdin ( buffer stdin size -- )
|
||||||
|
|
|
@ -339,7 +339,7 @@ void *stdin_loop(void *arg)
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
size_t bytes = read(0,buf,sizeof(buf));
|
ssize_t bytes = read(0,buf,sizeof(buf));
|
||||||
if(bytes < 0)
|
if(bytes < 0)
|
||||||
{
|
{
|
||||||
if(errno == EINTR)
|
if(errno == EINTR)
|
||||||
|
|
Loading…
Reference in New Issue