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

Re: svn commit: r10132 - trunk/subversion/clients/cmdline

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-07-04 19:51:43 CEST

On Sun, 2004-07-04 at 13:25, Ben Reser wrote:
>> I did not miss the point of the exercise. If a handled signal is
>> invoked, apr_poll() will (on Unix) terminate with EINTR.

> Ohhh. Didn't realize that.

It occurred to me after writing that that a cancellation doesn't
necessarily come from a signal. But since this is a text prompt
function, I think it's fair to only worry about cancellations from

> Does that logic look right:
> if (ctx)
> SVN_ERR (ctx->cancel_func (ctx->cancel_baton));
> status = wait_for_input (fp, pool);
> if (APR_STATUS_IS_EINTR (status))
> {
> if (ctx)
> SVN_ERR (ctx->cancel_func (ctx->cancel_baton));
> continue;

Just continue. You'll be calling the cancel function again at the top
of the loop.

> }
> else if (status && status != APR_ENOTIMPL)
> return svn_error_wrap_apr (status, _("Can't read stdin"));

Otherwise looks fine to me.

It would be better if we could just read the input and get APR to tell
us about EINTRs, so that you could hit ^C at a prompt even after you've
typed someting. But I don't see any way of doing that. (Oddly, it
looks like APR might do what I want for buffered files only, but that
doesn't seem like something to rely on, and I would assume stdin is
unbuffered anyway.)

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jul 4 19:52:33 2004

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.