[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: Ben Reser <ben_at_reser.org>
Date: 2004-07-04 20:15:45 CEST

On Sun, Jul 04, 2004 at 01:51:43PM -0400, Greg Hudson wrote:
> 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
> signals.

Yeah but the only time we set cancelled = TRUE right now is when we got
a signal. So yeah it's safe. I can't imagine any other reason for us
to be canceling.

> > 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.

err yeah.

> > }
> > 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.)

Ohh I whole heartily agreeded. I looked for a way to just get APR to do
this without me having to do the hoop jumping. But couldn't find one.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jul 4 20:19:00 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.