> On Fre, 2002-03-15 at 15:05, Volker Stolz wrote:
> > Am 15. Mar 2002 um 14:39 MET schrieb Volker Wysk:
> > > - If instead the child's child (echo.c) closes stdin 
> immediately after
> > > being executed, some data is lost.
> > 
> > Where's the use in closing stdin when you're passing arguments as
> > parameters? This is effectively a NOP and shouldn't 
> influence the result,
> > so I'd expect the same "missing" data as in your original case.
> 
> Yes, it's a NOP (just to be sure). The difference is in child.hs:
> 
> callIO (\ps -> "Kommando fehlgeschlagen mit " ++ show ps 
>         ++ ":\n" ++ kommando prog par)
>            (executeFile' prog True par Nothing)
> -- instead, to avoid bug:
> --         (hClose stdin >> executeFile' prog True par Nothing)
> 
> If you use the commented out line instead of the one in effect
> ("(executeFile' prog..."), you get the first behaviour, which is, the
> problem doesn't occur.

I'm still investigating this.  It appears that the child process *is*
reading from stdin before doing the exec, but I'm not sure why.  But
this at least partially explains why the parent process doesn't get to
see all the data on stdin.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to