[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: CVS Feature Branch - version - cannot write to stdout
From: |
Conrad T. Pino |
Subject: |
RE: CVS Feature Branch - version - cannot write to stdout |
Date: |
Mon, 11 Oct 2004 12:43:15 -0700 |
Hi Mark,
> From: Mark D. Baushke
>
> Hmmm... I wish I had a better #define to use to control this behavior...
> I suspect it may not be a problem in a cygwin environment, but I could
> be wrong.
Why not create a specific #define for this purpose?
The Windows Build has platform specific peculiarities that don't mesh with
the *nix build at all. File "windows-NT/config.h.in.footer" is where the
Windows Build #defines HAVE_WINSOCK_H and other stuff. Take a look to get
a sense of what we're doing there and propose a feature specific macro name.
I'm of the opinion that CVS Windows binary should be built for the bare
platform i.e. no Cygwin, MinGW, etc. environments.
> The following replacement functions should fix your problem (let me know
> if it does not). If anyone has a 'better' way to deal with the problem,
> please let me know...
The patch I tested follows at the end of this message.
I used:
#ifndef HAVE_WINSOCK_H
instead of:
#if !defined(HAVE_WINSOCK_H)
I won't commit until I see a response from you regarding proposal to use
new macro name other than HAVE_WINSOCK_H.
> Thanks,
> -- Mark
Conrad
Index: src/client.c
===================================================================
RCS file: /cvs/ccvs/src/client.c,v
retrieving revision 1.397
diff -u -p -r1.397 client.c
--- src/client.c 8 Oct 2004 19:45:19 -0000 1.397
+++ src/client.c 11 Oct 2004 19:37:50 -0000
@@ -2658,8 +2658,10 @@ handle_wrapper_rcs_option (char *args, i
static void
handle_m (char *args, int len)
{
+#ifndef HAVE_WINSOCK_H
fd_set wfds;
int s;
+#endif
/* In the case where stdout and stderr point to the same place,
fflushing stderr will make output happen in the correct order.
@@ -2668,11 +2670,13 @@ handle_m (char *args, int len)
based on being confused between default buffering between
stdout and stderr. But I'm not sure). */
fflush (stderr);
+#ifndef HAVE_WINSOCK_H
FD_ZERO (&wfds);
FD_SET (STDOUT_FILENO, &wfds);
s = select (STDOUT_FILENO+1, NULL, &wfds, NULL, NULL);
if (s < 1)
perror ("cannot write to stdout");
+#endif
fwrite (args, len, sizeof (*args), stdout);
putc ('\n', stdout);
}
@@ -2718,12 +2722,15 @@ handle_mbinary (char *args, int len)
static void
handle_e (char *args, int len)
{
+#ifndef HAVE_WINSOCK_H
fd_set wfds;
int s;
+#endif
/* In the case where stdout and stderr point to the same place,
fflushing stdout will make output happen in the correct order. */
fflush (stdout);
+#ifndef HAVE_WINSOCK_H
FD_ZERO (&wfds);
FD_SET (STDERR_FILENO, &wfds);
s = select (STDERR_FILENO+1, NULL, &wfds, NULL, NULL);
@@ -2735,6 +2742,7 @@ handle_e (char *args, int len)
*/
if (s < 1)
fperrmsg (stdout, 1, errno, "cannot write to stderr");
+#endif
fwrite (args, len, sizeof (*args), stderr);
putc ('\n', stderr);
}
- CVS Feature Branch - version - cannot write to stdout, Conrad T. Pino, 2004/10/09
- Re: CVS Feature Branch - version - cannot write to stdout, Mark D. Baushke, 2004/10/09
- RE: CVS Feature Branch - version - cannot write to stdout, Conrad T. Pino, 2004/10/09
- Re: CVS Feature Branch - version - cannot write to stdout, Mark D. Baushke, 2004/10/09
- Re: CVS Feature Branch - version - cannot write to stdout, Derek Robert Price, 2004/10/09
- RE: CVS Feature Branch - version - cannot write to stdout, Conrad T. Pino, 2004/10/11
- Re: CVS Feature Branch - version - cannot write to stdout, Mark D. Baushke, 2004/10/11
- RE: CVS Feature Branch - version - cannot write to stdout,
Conrad T. Pino <=
- Re: CVS Feature Branch - version - cannot write to stdout, Mark D. Baushke, 2004/10/11
- Re: CVS Feature Branch - version - cannot write to stdout, Mark D. Baushke, 2004/10/20
- RE: CVS Feature Branch - version - cannot write to stdout, Conrad T. Pino, 2004/10/22
- Re: CVS Feature Branch - version - cannot write to stdout, Mark D. Baushke, 2004/10/22
- RE: CVS Feature Branch - version - cannot write to stdout, Conrad T. Pino, 2004/10/22
- RE: CVS Feature Branch - version - cannot write to stdout, Conrad T. Pino, 2004/10/22