Fix EINTR handling in Unix stdin pipe hack

db4
Slava Pestov 2008-07-06 04:12:46 -05:00
parent e6282fe1a8
commit 0f6ecc10cd
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ M: stdin dispose
: wait-for-stdin ( stdin -- n )
[ 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 ;
:: refill-stdin ( buffer stdin size -- )

View File

@ -339,7 +339,7 @@ void *stdin_loop(void *arg)
for(;;)
{
size_t bytes = read(0,buf,sizeof(buf));
ssize_t bytes = read(0,buf,sizeof(buf));
if(bytes < 0)
{
if(errno == EINTR)