Commit 06409c99 authored by Mart Lubbers's avatar Mart Lubbers

Check for nullpointer in ptsname

parent c29e71e7
......@@ -90,15 +90,14 @@ where
runProcessPty :: !FilePath ![String] !(Maybe String) !*World -> (MaybeOSError (ProcessHandle, ProcessIO), *World)
runProcessPty path args mCurrentDirectory world
# (masterPty, world) = openPty world
| isError masterPty = (liftError masterPty, world)
# masterPty = fromOk masterPty
# (masterPty, world) = posix_openpt (O_RDWR bitor O_NOCTTY) world
| masterPty == -1 = getLastOSError world
# (slavePty, world) = grantpt masterPty world
| slavePty == -1 = getLastOSError world
# (slavePty, world) = unlockpt masterPty world
| slavePty == -1 = getLastOSError world
# (slavePty, world) = ptsname masterPty world
| slavePty == -1 = getLastOSError world
| slavePty == 0 = getLastOSError world
// StdOut
# (pipeStdOut, world) = openPipe world
| isError pipeStdOut = (liftError pipeStdOut, world)
......@@ -249,13 +248,6 @@ where
fillArgv arg_n [] argv args_memory
= {argv & [arg_n]=0}
openPty :: !*World -> (MaybeOSError Int, !*World)
openPty world
# (res, world) = posix_openpt (O_RDWR bitor O_NOCTTY) world
| res == -1
= getLastOSError world
= (Ok res, world)
openPipe :: !*World -> (MaybeOSError (Int, Int), !*World)
openPipe world
# ptr = malloc 8
......
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