Commit f524289c authored by Mart's avatar Mart

Fix select, strictness

parent f5903e2e
Pipeline #41947 passed with stage
in 2 minutes and 12 seconds
......@@ -354,8 +354,10 @@ callProcess path args mCurrentDirectory world
readPipeNonBlocking :: !ReadPipe !*World -> (!MaybeOSError String, !*World)
readPipeNonBlocking (ReadPipe fd) world
# timeout = writeInt (writeInt (malloc 16) 0 0) 8 0
# (res, world) = readSelect [fd] timeout world
# (timeout, world) = mallocSt 16 world
# timeout = writeInt (writeInt timeout 0 0) 8 0
# ((res, world), timeout) = readP (\ptr->readSelect [fd] ptr world) timeout
# world = freeSt timeout world
| isError res = (liftError res, world)
| and (fromOk res) = realRead fd world
= (Ok "", world)
......@@ -397,8 +399,8 @@ readSelect fds timeout world
# readfds = seq [\ptr -> writeIntElemOffset ptr i 0 \\ i <- [0..IF_INT_64_OR_32 15 31]] readfds
# readfds = seq [setFdBit fd\\fd<-fds] readfds
# (res, world) = select_ (maximum fds + 1) readfds 0 0 timeout world
| res == -1 = getLastOSError world
# res = [getFdBit fd readfds\\fd<-fds]
| res == -1 = getLastOSError (freeSt readfds world)
# (res, readfds) = seqList [readP (getFdBit fd)\\fd<-fds] readfds
# world = freeSt readfds world
= (Ok res, world)
where
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment