[darcs-devel] Better error reporting for exec_ and friends

Eric Y. Kow eric.kow at gmail.com
Thu Sep 28 16:25:13 PDT 2006


Hi,

On Sun, Sep 24, 2006 at 22:34:54 -0400, Magnus Jonsson wrote:
> What this patch does is, it introduces a new exception ExecFailed that 
> gets thrown if exec_ fails to at all execute the file. Because of the 
> design of unix, detectin this condition requires some hackery involving 
> pipes (njs suggested this to me on irc). I also added a handler at 
> toplevel main to report the ExecFailed exceptions to the user. Other than 
> this, exec_ and friends behave exactly as before.
> 
> Let me know what you think. I'm ready to do some revision if you guys 
> think it's needed.

The exec stuff has changed considerably (in the current batch of
accepted patches).  Would you please rewrite your patch in light of the
new changes?

I haven't had a deep look.  Some questions:

1) It adds some new exit codes for internal usage, paraphrasing the comments,
      -1 for fork() failure
      -2 for pipe(),
      -3 execvp_no_vtalarm()
    Dut does this mean we're counting on the programs themselves never
    exiting with these codes?

2) These exit codes don't actually get returned by darcs, right? You
   catch them and then just throw an ExitFailure if it's one of the
   expected codes
 
3) I'm a bit nervous about catching ExitFailure at main - it seems like
   this is something we would want to bubble up.  How do you know this
   doesn't misreport ExitFailures thrown by darcs itself?
 
4) Any reason the bulk of the code is written in C and not Haskell?

Thanks!

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20060929/926d49e8/attachment.pgp


More information about the darcs-devel mailing list