Ticket #132: process.diff

File process.diff, 4.5 KB (added by igloo, 4 years ago)
  • System/Process/Internals.hs

    Sat Jul 25 22:20:19 BST 2009  Ian Lynagh <igloo@earth.li>
      * Make the code compatible with the stricter labelled-field parsing rules
    diff -rN -u old-process/System/Process/Internals.hs new-process/System/Process/Internals.hs
    old new  
    213213-- ----------------------------------------------------------------------------- 
    214214-- POSIX runProcess with signal handling in the child 
    215215 
    216 runGenProcess_ fun CreateProcess{ cmdspec = cmdsp, 
    217                                   cwd = mb_cwd, 
    218                                   env = mb_env, 
    219                                   std_in = mb_stdin, 
    220                                   std_out = mb_stdout, 
    221                                   std_err = mb_stderr, 
    222                                   close_fds = mb_close_fds } 
     216runGenProcess_ fun (CreateProcess{ cmdspec = cmdsp, 
     217                                   cwd = mb_cwd, 
     218                                   env = mb_env, 
     219                                   std_in = mb_stdin, 
     220                                   std_out = mb_stdout, 
     221                                   std_err = mb_stderr, 
     222                                   close_fds = mb_close_fds }) 
    223223               mb_sigint mb_sigquit 
    224224 = do 
    225225  let (cmd,args) = commandToProcess cmdsp 
     
    444444#if __GLASGOW_HASKELL__ < 611 
    445445  withHandle_ fun hdl $ return . haFD 
    446446#else 
    447   withHandle fun hdl $ \h@Handle__{haDevice=dev,..} -> 
     447  withHandle fun hdl $ \h@(Handle__{haDevice=dev,..}) -> 
    448448    case cast dev of 
    449449      Just fd -> do 
    450450         -- clear the O_NONBLOCK flag on this FD, if it is set, since 
  • System/Process.hs

    diff -rN -u old-process/System/Process.hs new-process/System/Process.hs
    old new  
    135135runProcess cmd args mb_cwd mb_env mb_stdin mb_stdout mb_stderr = do 
    136136  (_,_,_,ph) <- 
    137137      runGenProcess_ "runProcess" 
    138          (proc cmd args){ cwd = mb_cwd, 
    139                           env = mb_env, 
    140                           std_in  = mbToStd mb_stdin, 
    141                           std_out = mbToStd mb_stdout, 
    142                           std_err = mbToStd mb_stderr } 
     138         ((proc cmd args){ cwd = mb_cwd, 
     139                           env = mb_env, 
     140                           std_in  = mbToStd mb_stdin, 
     141                           std_out = mbToStd mb_stdout, 
     142                           std_err = mbToStd mb_stderr }) 
    143143          Nothing Nothing 
    144144  maybeClose mb_stdin 
    145145  maybeClose mb_stdout 
     
    273273 
    274274runInteractiveProcess cmd args mb_cwd mb_env = do 
    275275  runInteractiveProcess1 "runInteractiveProcess"  
    276         (proc cmd args){ cwd = mb_cwd, env = mb_env } 
     276        ((proc cmd args){ cwd = mb_cwd, env = mb_env }) 
    277277 
    278278runInteractiveProcess1 
    279279  :: String 
     
    282282runInteractiveProcess1 fun cmd = do 
    283283  (mb_in, mb_out, mb_err, p) <-  
    284284      runGenProcess_ fun 
    285            cmd{ std_in  = CreatePipe, 
    286                 std_out = CreatePipe, 
    287                 std_err = CreatePipe }  
     285           (cmd{ std_in  = CreatePipe, 
     286                 std_out = CreatePipe, 
     287                 std_err = CreatePipe }) 
    288288           Nothing Nothing 
    289289  return (fromJust mb_in, fromJust mb_out, fromJust mb_err, p) 
    290290 
     
    351351    -> IO String                -- ^ stdout + stderr 
    352352readProcess cmd args input = do 
    353353    (Just inh, Just outh, _, pid) <- 
    354         createProcess (proc cmd args){ std_in  = CreatePipe, 
    355                                        std_out = CreatePipe, 
    356                                        std_err = Inherit } 
     354        createProcess ((proc cmd args){ std_in  = CreatePipe, 
     355                                        std_out = CreatePipe, 
     356                                        std_err = Inherit }) 
    357357 
    358358    -- fork off a thread to start consuming the output 
    359359    output  <- hGetContents outh 
     
    398398    -> IO (ExitCode,String,String) -- ^ exitcode, stdout, stderr 
    399399readProcessWithExitCode cmd args input = do 
    400400    (Just inh, Just outh, Just errh, pid) <- 
    401         createProcess (proc cmd args){ std_in  = CreatePipe, 
    402                                        std_out = CreatePipe, 
    403                                        std_err = CreatePipe } 
     401        createProcess ((proc cmd args){ std_in  = CreatePipe, 
     402                                        std_out = CreatePipe, 
     403                                        std_err = CreatePipe }) 
    404404 
    405405    outMVar <- newEmptyMVar 
    406406