This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposal for Subversion Cygwin Port


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mathias Weinert wrote (a long time ago):
> I encountered another textmode problem: svnadmin dump and load work
> with stdout and stdin and these work in textmode on a textmode
> mounted path... I decided to use the setmode function to solve this
> problem. I patched the apr functions apr_file_open_stderr,
> apr_file_open_stdout and apr_file_open_stdin as I think it won't mind
> if stderr, stdout and stdin always work in binary mode (does it?)
> (see below).

> --- file_io/unix/open.c.orig        2004-03-24 21:09:18.000000000 +0100
> +++ file_io/unix/open.c        2005-02-18 08:18:28.514978300 +0100
> @@ -238,24 +238,27 @@
>  APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile,
>                                                 apr_pool_t *pool)
>  {
>      int fd = STDERR_FILENO;
> +    setmode(fd, O_BINARY);
>  
>      return apr_os_file_put(thefile, &fd, 0, pool);
>  }
>  
>  APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile,
>                                                 apr_pool_t *pool)
>  {
>      int fd = STDOUT_FILENO;
> +    setmode(fd, O_BINARY);
>  
>      return apr_os_file_put(thefile, &fd, 0, pool);
>  }
>  
>  APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
>                                                apr_pool_t *pool)
>  {
>      int fd = STDIN_FILENO;
> +    setmode(fd, O_BINARY);
>  
>      return apr_os_file_put(thefile, &fd, 0, pool);
>  }

First, sorry for letting this slip my attention, and thanks for your
off-list reminder.

I've now got around to researching all the uses of apr_file_open_stdfoo
in Subversion, and some of them (most, even) are handling textual, not
binary, data.

Also, the above suggested solution disturbs me, since it is unexpected
for instantiating an wrapper object to make changes to the thing it wraps.

With a general solution seeming elusive, I think the best course of
action would be to simply add some setmode(STDFOO_FILENO, O_BINARY)
calls to the Subversion executables which handle binary streams on
stdin/out.

I'll do this ASAP, since I need to get a Subversion 1.3.0 package out
anyway.

Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFD7e7nfFNSmcDyxYARAlM/AKCbRohGxIZ79PcNeJwS+86v7pUxAgCdG2CR
psW+h4eNBxmsUddpVh8Xvb0=
=5qJP
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]