bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redirecting stderr failure on :ext: ssh and large data


From: Mark D. Baushke
Subject: Re: redirecting stderr failure on :ext: ssh and large data
Date: Tue, 10 Aug 2004 15:09:51 -0700

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

Frank Hemer <frank@hemer.org> writes:

> I just discovered a bug with stderr redirection.

Which version of cvs did you test? We were recently informed that this
problem may have been fixed in cvs 1.12.9 (although that is by no means
certain).

> In case some app starts cvs as coprocess and has redirected stderr before:
> 
> dup2(STDOUT_FILENO,STDERR_FILENO);
> 
> cvs will lose data. This only applies to :ext: method with CVS_RSH set to ssh 
> and a filesize of a few thousand lines (tested with diff --side-by-side).
> 
> Changing the following code in client.c/handle_m(args, len)  will fix this:
> 
> >>>>>>>>>>>>>>>>> old >>>>>>>>>>>>>>>>>>
> 
>     fflush (stderr);
>     fwrite (args, len, sizeof (*args), stdout);
>     putc ('\n', stdout);
> 
> <<<<<<<<<<<<<<<< new <<<<<<<<<<<<<<<<<<
> 
>     fflush (stderr);
> 
>     fd_set wfds;
>     FD_ZERO(&wfds);
>     FD_SET(STDOUT_FILENO, &wfds);
>     int s = select(STDOUT_FILENO+1,NULL,&wfds,NULL,NULL);
>     if (s < 1) {
>        perror("cannot write to stdout");
>     }
> 
>     fwrite (args, len, sizeof (*args), stdout);
>     putc ('\n', stdout);
> 
> >>>>>>>>>>>>>>> end >>>>>>>>>>>>>>>>>>>

Would a similar change need to be made to handle_e () as well?

See this thread for all the gory details of the previous time this
problem was raised:

    <http://lists.gnu.org/archive/html/bug-cvs/2002-07/msg00084.html>

as well as the recent thread on bug-cvs

    <http://lists.gnu.org/archive/html/bug-cvs/2004-08/msg00024.html>

which also discusses the problem.

In light of the above threads, do you really believe that your patch is
correct?

        -- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFBGUev3x41pRYZE/gRAqkTAJwPjjBzb5oJzhPV9keTz+zDs+FX3QCfe0Ce
SaQ1BDqv/OCBJ1qFhEVbtWg=
=Aq0V
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]