[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problem with apr_proc_wait and/or svn_io_run_cmd

From: <joe_at_manyfish.co.uk>
Date: 2003-01-23 11:01:28 CET

On Wed, Jan 22, 2003 at 11:44:08PM -0500, Eric Gillespie wrote:
 As an attempt to make this on-topic for both lists, i won't go
 into how i discovered the bug. I don't think it's necessary.
 Correctly using waitpid(2) involves checking for EINTR and trying
 again. That leads to common usage being something like this:

That does look like a bug.

 It looks like the APR equivalent is supposed to be:
     do {
         apr_err = apr_proc_wait (cmd_proc, exitcode_val,
                                  exitwhy_val, APR_WAIT);
     } while (APR_STATUS_IS_CHILD_NOTDONE (apr_err));
 Is that correct?

I don't think so really: the child will only be NOTDONE if you pass in
APR_NOWAIT; otherwise, the waitpid waits until the child *is* done.

 It may be as simple as changing APR_STATUS_IS_CHILD_NOTDONE, in
 which case apr_proc_wait doesn't need to change at all. But i am
 not sure that is the solution. No matter what, svn_io_run_cmd
 will need to change so that it repeats the apr_proc_wait call as
 necessary (unless you want to make apr_proc_wait itself loop over
 waitpid(2), which i think is NOT the way to go).

My guess would be to make apr_proc_wait loop over waitpid whilst
errno=EINTR; that's what the rest of APR does. Though the interactions
between waitpid and SIGCHLD here are a bit daunting, just from reading
the Linux waitpid() man page.



To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:09:02 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.