[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
redirecting stderr failure on :ext: ssh and large data
From: |
Frank Hemer |
Subject: |
redirecting stderr failure on :ext: ssh and large data |
Date: |
Tue, 10 Aug 2004 22:37:47 +0200 |
User-agent: |
KMail/1.5.1 |
I just discovered a bug with stderr redirection.
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 >>>>>>>>>>>>>>>>>>>
Frank
- redirecting stderr failure on :ext: ssh and large data,
Frank Hemer <=