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

Re: Hooks on Windows]

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-08-18 02:35:43 CEST

D.J. Heap wrote:

> Ok, after more investigating I've found the problem, I believe.
>
> Windows appears to expect ALL std handles to be set to valid handles if
> the STARTF_USESTDHANDLES flag is set in the STARTUPINFO -- but *only*
> for .cmd and .bat files...exe's don't seem to have a problem.

Nice catch!

> When Subversion launches a pre-commit hook, it doesn't specify a stdout
> handle, only a stderr one -- so apr_proc_create sets the stdout handle
> to INVALID_HANDLE_VALUE. Then what's happening is the shell script
> writes to stdout, the stdout handle is bad, and Windows (cmd.exe, I
> suspect) spits out a 'Invalid handle' message to stderr. Thus, stderr
> output is littered with invalid handle messages as well as the normal
> stderr output.
>
> Very weird, since it doesn't seem to apply to exe's (probably, cmd.exe
> is 'helping' by printing error messages to stderr or something and
> normal exe's just ignore the write failure).

Probably, yes. Most exe's use stdio for output, anyway, and I've yet to
see a program that checks ferror(stdout) after a write. :-)

> Anyway, I'm not sure what exactly should be done to fix it...change APR
> to provide a valid handle if the caller doesn't, or if Subversion should
> just specify stdout as well or...?

Nope, I'd say we should only add a note about this to the APR
documentation. SVN should provide a stdout handle, even if it's to
/dev/null (or equivalent).

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 18 02:34:24 2003

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.