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

Re: svn commit: r9806 - in trunk/subversion: include libsvn_subr

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2004-05-21 14:28:57 CEST

On Thu, 20 May 2004 lundblad@tigris.org wrote:

> Author: lundblad
> Date: Thu May 20 18:30:05 2004
> New Revision: 9806
>
> Log:
> Actually check for write errors in svn_cmdline_printf, svn_cmdline__fprint and
> svn_cmdline_fputs.
>
> * libsvn_subr/cmdline.c (svn_cmdline_fputs): Check the call of fputs()
> fo errors and return it in that case.
>
>
> Modified: trunk/subversion/libsvn_subr/cmdline.c
> ==============================================================================
> --- trunk/subversion/libsvn_subr/cmdline.c (original)
> +++ trunk/subversion/libsvn_subr/cmdline.c Thu May 20 18:30:05 2004
> @@ -268,7 +268,21 @@
> out = svn_cmdline_cstring_from_utf8_fuzzy (string, pool);
> }
>
> - fputs (out, stream);
> + /* On POSIX systems, errno will be set on an error in fputs, but this might
> + not be the case on other platforms. We reset the OS error and only
> + use it if it was set by the below fputs call. Else, we just return
> + a generic error. */
> + apr_set_os_error (APR_SUCCESS);
> +
> + if (fputs (out, stream) == EOF)
> + {
> + apr_status_t status = apr_get_os_error ();

This obviously works on my Linux box. Anyone who knows if this is correct
on platforms such as Win32?

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 21 15:03:41 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.