summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/windows-NT
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-10-18 03:37:12 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-10-18 03:37:12 +0000
commit336031efaf37038aec514de88cc3ed6ac651bea9 (patch)
tree6e7eaec5ac8b729546276d6a0932387996c9e92c /gnu/usr.bin/cvs/windows-NT
parentc99a600e0a1fec1e87fd19470c2c4cf7c8ce36ed (diff)
New release from Cyclic Software
Diffstat (limited to 'gnu/usr.bin/cvs/windows-NT')
-rw-r--r--gnu/usr.bin/cvs/windows-NT/.cvsignore2
-rw-r--r--gnu/usr.bin/cvs/windows-NT/ChangeLog120
-rw-r--r--gnu/usr.bin/cvs/windows-NT/Makefile.in3
-rw-r--r--gnu/usr.bin/cvs/windows-NT/README72
-rw-r--r--gnu/usr.bin/cvs/windows-NT/config.h38
-rw-r--r--gnu/usr.bin/cvs/windows-NT/filesubr.c147
-rw-r--r--gnu/usr.bin/cvs/windows-NT/options.h25
-rw-r--r--gnu/usr.bin/cvs/windows-NT/rcmd.c22
-rw-r--r--gnu/usr.bin/cvs/windows-NT/run.c15
-rw-r--r--gnu/usr.bin/cvs/windows-NT/startserver.c36
10 files changed, 373 insertions, 107 deletions
diff --git a/gnu/usr.bin/cvs/windows-NT/.cvsignore b/gnu/usr.bin/cvs/windows-NT/.cvsignore
index f3c7a7c5da6..311409c80d7 100644
--- a/gnu/usr.bin/cvs/windows-NT/.cvsignore
+++ b/gnu/usr.bin/cvs/windows-NT/.cvsignore
@@ -1 +1,3 @@
Makefile
+check.log
+check.plog
diff --git a/gnu/usr.bin/cvs/windows-NT/ChangeLog b/gnu/usr.bin/cvs/windows-NT/ChangeLog
index 300ad830f41..9589a96dab7 100644
--- a/gnu/usr.bin/cvs/windows-NT/ChangeLog
+++ b/gnu/usr.bin/cvs/windows-NT/ChangeLog
@@ -1,3 +1,123 @@
+Wed Sep 25 14:31:51 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * options.h (TMPDIR_DFLT): Change from c:\temp to c:\\temp.
+
+Tue Sep 24 14:37:29 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * options.h: Add TMPDIR_DFLT.
+
+Tue Sep 10 19:20:25 1996 Mark A. Solinski <markso@mcs.com>
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ This is said to be the last set of changes needed for Win95:
+ * rcmd.c: Include cvs.h.
+ (rcmd_authenticate): Use send/recv instead of read/write.
+ (rcmd): Don't call _open_osfhandle; just return the socket.
+ * options.h: Move NO_SOCKET_TO_FD from here...
+ * config.h: ...to here. Update comment.
+ * config.h (START_SERVER_RETURNS_SOCKET, SEND_NEVER_PARTIAL):
+ Define.
+ * startserver.c (shutdown_fd): Remove; it is unused.
+ (wnt_start_server): Don't dup the file descriptor; instead set
+ both *tofd and *fromfd to read_fd.
+ (wnt_shutdown_server): Don't call _get_osfhandle; just use the
+ argument as the socket.
+
+Wed Sep 4 1996 Jim Kingdon <kingdon@cyclic.com>
+
+ * filesubr.c (mkdir_if_needed): mkdir on NT only takes one,
+ not two, arguments.
+
+Thu Aug 29 09:47:33 1996 Mark A. Solinski <markso@mcs.com>
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * filesubr.c (deep_remove_dir, unlink_file_dir): ENOENT can also
+ mean that we tried to unlink a directory (Win95).
+
+Mon Aug 26 12:47:58 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * filesubr.c (mkdir_if_needed): Added.
+
+Thu Aug 22 19:12:17 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ The following changes are said to be necessary (but not
+ sufficient) for Win95:
+ * config.h (sleep): Use "unsigned int" not just "unsigned".
+ * filesubr.c (deep_remove_dir): Treat EACCES as well as ENOTEMPTY
+ as an indication that we need to remove the directory.
+
+Fri Aug 16 16:06:22 1996 Norbert Kiesel <nk@col.sw-ley.de>
+
+ * Makefile.in (installdirs): new (empty) target
+
+Mon Aug 12 14:45:16 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * config.h: Remove CLIENT_ONLY; it is nowhere used.
+
+Mon Jul 15 1996 Jim Kingdon <kingdon@cyclic.com>
+
+ * README: Add note about tab stop setting.
+
+Fri Jun 7 13:07:37 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * config.h: Change INITIALIZE_SOCKET_SUBSYSTEM to
+ SYSTEM_INITIALIZE to reflect change in ../src/main.c.
+
+Mon Jun 03 01:00:08 1996 noel <noel@BOAT_ANCHOR>
+
+ * sanity.sh: include new tests from ../src/sanity.sh.
+
+ * filesubr.c (copy_file): use open with O_CREAT instead of creat
+ so we can also use O_BINARY -- we don't want to do any LF -> CR/LF
+ translations when we copy files.
+
+Fri May 17 11:53:13 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README: In a few places it used to say "server" when it meant
+ "client". Fix it. Say explicitly that there is no server on NT.
+ Fix typos (4,0 -> 4.0; CVS.system -> CVS).
+
+Thu May 16 16:52:45 1996 Noel Cragg <noel@gargle.rain.org>
+
+ * README: explain which utilities are required for client support
+ and local support in separate paragraphs.
+
+ * filesubr.c (expand_wild): rename max to cvs_max to avoid
+ conflicts with other already-defined routines.
+ (get_homedir): rename min to cvs_min.
+
+Thu May 16 01:18:22 1996 noel <noel@BOAT_ANCHOR>
+
+ * sanity.sh: Hacked version of src/sanity.sh for use under
+ CYGWIN32.
+
+ * filesubr.c (expand_wild): Since FindFirstFile and FindNextFile
+ don't return the pathname of a file, we need to keep track of it
+ ourselves.
+
+ * options.h: Fix defines for DIFF and GREP.
+
+ * run.c (run_exec): Flush stdout and stderr so we end up with the
+ correct interleaving of output for sanity.sh. This can be removed
+ later, if desired.
+
+Wed May 15 23:51:49 1996 Noel Cragg <noel@gargle.rain.org>
+
+ * README: mention that grep is mandatory.
+
+Tue May 14 1996 Jim Kingdon <kingdon@cyclic.com>
+
+ * filesubr.c (cvs_temp_name): Call _tempnam not tmpnam.
+
+Tue May 14 13:38:51 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * filesubr.c (cvs_temp_name): New function..
+
+Wed May 01 01:28:41 1996 noel <noel@BOAT_ANCHOR>
+
+ * filesubr.c (get_homedir): use both HOMEDRIVE and HOMEPATH to
+ construct the user's home directory.
+
Tue Apr 9 20:56:14 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
* README: Mention CRLF for src/server.c.
diff --git a/gnu/usr.bin/cvs/windows-NT/Makefile.in b/gnu/usr.bin/cvs/windows-NT/Makefile.in
index 0275e27249a..2fd0d3a9197 100644
--- a/gnu/usr.bin/cvs/windows-NT/Makefile.in
+++ b/gnu/usr.bin/cvs/windows-NT/Makefile.in
@@ -39,6 +39,9 @@ all:
.PHONY: all install uninstall
all install uninstall:
+installdirs:
+.PHONY: installdirs
+
.PHONY: tags TAGS
tags TAGS:
diff --git a/gnu/usr.bin/cvs/windows-NT/README b/gnu/usr.bin/cvs/windows-NT/README
index 0f9035985e5..057320e0bb7 100644
--- a/gnu/usr.bin/cvs/windows-NT/README
+++ b/gnu/usr.bin/cvs/windows-NT/README
@@ -5,10 +5,8 @@
Check the ../INSTALL file for information on the most recent version
of CVS which has been known to be tested with NT.
-The port implements the full set of CVS commands, but is client only,
-not server or local ("local" meaning accessing repositories on a
-filesystem mounted on the local machine). The repository must live on
-another machine (a Unix box, say) which runs a complete port of CVS.
+This port implements the full set of CVS commands, both local and
+client. It does not provide a CVS server for NT.
We don't distribute a .ZIP source distribution partly because, as far
as I can tell, PKZIP insists on munging long file names, which would
@@ -20,27 +18,63 @@ the sources get extracted without carriage returns and you must add
carriage returns to the end of every line in cvsnt.mak. I also had to
add them to src/server.c. It doesn't seem to be necessary to add them
to any other file. This makefile was generated with Visual C++ 2.1.
-As far as is known, it should work with Visual C++ 4,0 also.
+As far as is known, it should work with Visual C++ 4.0 also.
Send bug reports to bug-cvs@prep.ai.mit.edu.
-As of August 20, 1995, this port passed the test in src/sanity.sh.
-(We ran the checks by hand, since we couldn't find a port of the
-Bourne shell good enough to execute the script). Sanity.sh provides
-pretty minimal feature coverage, but still gives me some confidence it
-isn't totally broken.
+This port passes all of the tests in src/sanity.sh, save the one that
+deals with reserved all-upper-case tags (BASE and HEAD), due to a
+limitation in the NT command shell. sanity.sh provides pretty minimal
+feature coverage, but still gives me some confidence it isn't totally
+broken.
-You will also need GNU patch installed on your system. GZIP is useful
-but not required. The Congruent ports of these packages to Windows
-NT, binary and source, are available in:
+To operate in client mode, you will need GNU patch. gzip is useful
+but not required.
- ftp://microlib.cc.utexas.edu/microlib/nt/gnu
+To operate in local mode, you will need GNU patch, GNU diffutils, a
+version of grep, and rcs version 5.7 installed on your system. Make
+sure NOT to get a version of rcs less than 5.7 (gr564bnt.zip was
+particularly bad), because those versions insist on putting their
+files in their own directory structure, making them incompatible with
+CVS.
-If you'd like to finish off the port of local CVS, Morten Hindsholm's
-port of CVS 1.4A2 to Windows NT might be helpful; it is available as
+Noel Cragg, who did the latest mods to the Windows NT port, used the
+following packages:
+
+ ftp://wuarchive.wustl.edu/systems/ibmpc/gnuish/grep15.zip
+ ** use grepb.exe and egrepb.exe, but install as
+ ** grep.exe and egrep.exe respectively)
+ ftp://wuarchive.wustl.edu/systems/ibmpc/gnuish/patch212.zip
+ ftp://ftp.netcom.com/pub/al/alexande/rcs57nt.zip
+ ftp://ftp.netcom.com/pub/al/alexande/diff57nt.zip
+
+If you want to try other versions of these utilities, you might have
+luck with the Congruent ports of these packages to Windows NT, binary
+and source:
+
+ ftp://microlib.cc.utexas.edu/microlib/nt/gnu/
+
+The CYGWIN32 package is a port of various GNU tools for NT, providing
+bash as the shell and gcc as the compiler. The tools are still in
+development, but they are useful for running a modified version of
+sanity.sh:
+
+ http://www.cygnus.com/misc/gnu-win32/
+
+Morten Hindsholm's port of CVS 1.4A2 to Windows NT may be useful if
+you're modifying CVS itself:
ftp://ftp.digex.net/pub/access/schueman/cvs/cvsnt14b.zip
+Mark A. Solinski <markso@www.mcs.net> has ported CVS 1.7 to Windows
+95. You can find his source code at:
+
+ http://www.mcs.net/~markso/cvs/cvs95.html
+
+Here are some other things which may be of interest for unix junkies:
+
+ http://www.halcyon.com/gvr/vim/ (VI clone)
+ ftp://wuarchive.wustl.edu/systems/ibmpc/gnuish/less177.zip
The following harmless warnings are known:
@@ -50,3 +84,9 @@ The following harmless warnings are known:
.\lib\getdate.c(760) : warning C4013: 'getdate_yyparse' undefined; assuming extern returning int
.\lib\getdate.c(1612) : warning C4102: 'yyerrlab' : unreferenced label
.\lib\getdate.c(1612) : warning C4102: 'yynewstate' : unreferenced label
+
+If you want to browse/edit the sources using Visual C++, we recommend
+setting tab stops to 8 spaces, since that is what the CVS sources
+expect. The tab stop setting is in the "Editor" section of the "Options..."
+dialog which is in the "Tools..." menu.
+
diff --git a/gnu/usr.bin/cvs/windows-NT/config.h b/gnu/usr.bin/cvs/windows-NT/config.h
index e65c1172b89..736390a7b4b 100644
--- a/gnu/usr.bin/cvs/windows-NT/config.h
+++ b/gnu/usr.bin/cvs/windows-NT/config.h
@@ -11,12 +11,6 @@
We just want to avoid a redefinition error message. */
#undef _ALL_SOURCE
-/* Define if type char is unsigned and you are not using gcc. */
-/* We wrote a little test program whose output suggests that char is
- signed on this system. Go back and check the verdict when CVS
- is configured on floss... */
-#undef __CHAR_UNSIGNED__
-
/* Define to empty if the keyword does not work. */
/* Const is working. */
#undef const
@@ -40,11 +34,6 @@
I have neither the CD-ROM nor a CD-ROM drive to put it in. */
#define HAVE_UTIME_NULL 1
-/* Define as __inline if that's what the C compiler calls it. */
-/* We apparently do have inline functions. The 'inline' keyword is only
- available from C++, though. You have to use '__inline' in C code. */
-#define inline __inline
-
/* Define if on MINIX. */
/* Hah. */
#undef _MINIX
@@ -274,7 +263,7 @@ extern pid_t getpid (void);
#define USE_PROTOTYPES 1
/* This is just a call to the Win32 Sleep function. */
-unsigned sleep (unsigned);
+unsigned int sleep (unsigned int);
/* Don't worry, Microsoft, it's okay for these functions to
be in our namespace. */
@@ -316,12 +305,6 @@ extern void convert_file (char *INFILE, int INFLAGS,
/* This is where old bits go to die under Windows NT. */
#define DEVNULL "nul"
-/* Make sure that we don't try to perform operations on RCS files on the
- local machine. I think I neglected to apply some changes from
- MHI's port in that area of code, or found some issues I didn't want
- to deal with. */
-#define CLIENT_ONLY
-
/* Don't use an rsh subprocess to connect to the server, because
the rsh does inappropriate translations on the data (CR-LF/LF). */
#define RSH_NOT_TRANSPARENT 1
@@ -334,7 +317,24 @@ extern void wnt_shutdown_server (int fd);
#define START_SERVER wnt_start_server
#define SHUTDOWN_SERVER wnt_shutdown_server
-#define INITIALIZE_SOCKET_SUBSYSTEM init_winsock
+#define SYSTEM_INITIALIZE(pargc,pargv) init_winsock()
extern void init_winsock();
#define HAVE_WINSOCK_H
+
+/* This tells the client that it must use send()/recv() to talk to the
+ server if it is connected to the server via a socket; Win95 needs
+ it because _open_osfhandle doesn't work. */
+#define NO_SOCKET_TO_FD 1
+
+/* The internal rsh client uses sockets not file descriptors. Note
+ that as the code stands now, it often takes values from a SOCKET and
+ puts them in an int. This is ugly but it seems like sizeof
+ (SOCKET) <= sizeof (int) on win32, even the 64-bit variants. */
+#define START_SERVER_RETURNS_SOCKET 1
+
+/* Is this true on NT? Seems like I remember reports that NT 3.51 has
+ problems with 200K writes (of course, the issue of large writes is
+ moot since the use of buffer.c ensures that writes will only be as big
+ as the buffers). */
+#define SEND_NEVER_PARTIAL 1
diff --git a/gnu/usr.bin/cvs/windows-NT/filesubr.c b/gnu/usr.bin/cvs/windows-NT/filesubr.c
index e3cb9c398df..926e06799d5 100644
--- a/gnu/usr.bin/cvs/windows-NT/filesubr.c
+++ b/gnu/usr.bin/cvs/windows-NT/filesubr.c
@@ -26,14 +26,6 @@
#include "cvs.h"
-/*
- * I don't know of a convenient way to test this at configure time, or else
- * I'd certainly do it there.
- */
-#if defined(NeXT)
-#define LOSING_TMPNAM_FUNCTION
-#endif
-
static int deep_remove_dir PROTO((const char *path));
/*
@@ -62,7 +54,8 @@ copy_file (from, to)
error (1, errno, "cannot open %s for copying", from);
if (fstat (fdin, &sb) < 0)
error (1, errno, "cannot fstat %s", from);
- if ((fdout = creat (to, (int) sb.st_mode & 07777)) < 0)
+ if ((fdout = open (to, O_CREAT | O_TRUNC | O_RDWR | O_BINARY,
+ (int) sb.st_mode & 07777)) < 0)
error (1, errno, "cannot create %s for copying", to);
if (sb.st_size > 0)
{
@@ -307,6 +300,33 @@ make_directories (name)
(void) mkdir (name);
}
+/* Create directory NAME if it does not already exist; fatal error for
+ other errors. Returns 0 if directory was created; 1 if it already
+ existed. */
+int
+mkdir_if_needed (name)
+ char *name;
+{
+ if (mkdir (name) < 0)
+ {
+ if (errno != EEXIST
+#ifdef EACCESS
+ /* This was copied over from the OS/2 code; I would guess it
+ isn't needed here but that has not been verified. */
+ && errno != EACCESS
+#endif
+#ifdef EACCES
+ /* This is said to be needed by NT on Alpha or PowerPC
+ (not sure what version) --August, 1996. */
+ && errno != EACCES
+#endif
+ )
+ error (1, errno, "cannot make directory %s", name);
+ return 1;
+ }
+ return 0;
+}
+
/*
* Change the mode of a file, either adding write permissions, or removing
* all write permissions. Adding write permissions honors the current umask
@@ -461,8 +481,8 @@ unlink_file_dir (f)
if (unlink (f) != 0)
{
/* under Windows NT, unlink returns EACCES if the path
- is a directory. */
- if (errno == EISDIR || errno == EACCES)
+ is a directory. Under Windows 95, ENOENT. */
+ if (errno == EISDIR || errno == EACCES || errno == ENOENT)
return deep_remove_dir (f);
else
/* The file wasn't a directory and some other
@@ -486,7 +506,9 @@ deep_remove_dir (path)
struct dirent *dp;
char buf[PATH_MAX];
- if ( rmdir (path) != 0 && errno == ENOTEMPTY )
+ /* ENOTEMPTY for NT (obvious) but EACCES for Win95 (not obvious) */
+ if (rmdir (path) != 0
+ && (errno == ENOTEMPTY || errno == EACCES))
{
if ((dirp = opendir (path)) == NULL)
/* If unable to open the directory return
@@ -506,7 +528,14 @@ deep_remove_dir (path)
chmod (buf, _S_IWRITE);
if (unlink (buf) != 0 )
{
- if (errno == EISDIR || errno == EACCES)
+ /* Under Windows NT, unlink returns EACCES if the path
+ is a directory. Under Windows 95, ENOENT. It
+ isn't really clear to me whether checking errno is
+ better or worse than using _stat to check for a directory.
+ We aren't really trying to prevent race conditions here
+ (e.g. what if something changes between readdir and
+ unlink?) */
+ if (errno == EISDIR || errno == EACCES || errno == ENOENT)
{
if (deep_remove_dir (buf))
{
@@ -728,7 +757,21 @@ fnfold (char *filename)
}
}
+
+/* Generate a unique temporary filename. Returns a pointer to a newly
+ malloc'd string containing the name. Returns successfully or not at
+ all. */
+char *
+cvs_temp_name ()
+{
+ char *retval;
+ retval = _tempnam (NULL, NULL);
+ if (retval == NULL)
+ error (1, errno, "cannot generate temporary filename");
+ return retval;
+}
+
/* Return non-zero iff FILENAME is absolute.
Trivial under Unix, but more complicated under other systems. */
int
@@ -787,10 +830,37 @@ convert_file (char *infile, int inflags,
error (0, errno, "warning: couldn't close %s", infile);
}
+
+/* NT has two evironment variables, HOMEPATH and HOMEDRIVE, which,
+ when combined as ${HOMEDRIVE}${HOMEPATH}, give the unix equivalent
+ of HOME. Some NT users are just too unixy, though, and set the
+ HOME variable themselves. Therefore, we check for HOME first, and
+ then try to combine the other two if that fails. */
+
char *
get_homedir ()
{
- return getenv ("HOMEPATH");
+ static char pathbuf[PATH_MAX * 2];
+ char *hd, *hp;
+
+ if ((hd = getenv ("HOME")))
+ return hd;
+ else if ((hd = getenv ("HOMEDRIVE")) && (hp = getenv ("HOMEPATH")))
+ {
+ /* Watch for buffer overruns. */
+
+#define cvs_min(x,y) ((x <= y) ? (x) : (y))
+
+ int ld = cvs_min (PATH_MAX, strlen (hd));
+ int lp = cvs_min (PATH_MAX, strlen (hp));
+
+ strncpy (pathbuf, hd, ld);
+ strncpy (pathbuf + ld, hp, lp);
+
+ return pathbuf;
+ }
+ else
+ return NULL;
}
/* See cvs.h for description. */
@@ -817,6 +887,34 @@ expand_wild (argc, argv, pargc, pargv)
HANDLE h;
WIN32_FIND_DATA fdata;
+ /* These variables help us extract the directory name from the
+ given pathname. */
+
+ char *last_forw_slash, *last_back_slash, *end_of_dirname;
+ int dirname_length = 0;
+
+ /* FindFirstFile doesn't return pathnames, so we have to do
+ this ourselves. Luckily, it's no big deal, since globbing
+ characters under Win32s can only occur in the last segment
+ of the path. For example,
+ /a/path/q*.h valid
+ /w32/q*.dir/cant/do/this/q*.h invalid */
+
+ /* Win32 can handle both forward and backward slashes as
+ filenames -- check for both. */
+
+ last_forw_slash = strrchr (argv[i], '/');
+ last_back_slash = strrchr (argv[i], '\\');
+
+#define cvs_max(x,y) ((x >= y) ? (x) : (y))
+
+ end_of_dirname = cvs_max (last_forw_slash, last_back_slash);
+
+ if (end_of_dirname == NULL)
+ dirname_length = 0; /* no directory name */
+ else
+ dirname_length = end_of_dirname - argv[i] + 1; /* include slash */
+
h = FindFirstFile (argv[i], &fdata);
if (h == INVALID_HANDLE_VALUE)
{
@@ -842,7 +940,26 @@ expand_wild (argc, argv, pargc, pargv)
{
while (1)
{
- new_argv [new_argc++] = xstrdup (fdata.cFileName);
+ new_argv[new_argc] =
+ (char *) xmalloc (strlen (fdata.cFileName) + 1
+ + dirname_length);
+
+ /* Copy the directory name, if there is one. */
+
+ if (dirname_length)
+ {
+ strncpy (new_argv[new_argc], argv[i], dirname_length);
+ new_argv[new_argc][dirname_length] = '\0';
+ }
+ else
+ new_argv[new_argc][0] = '\0';
+
+ /* Copy the file name. */
+
+ strcat (new_argv[new_argc], fdata.cFileName);
+
+ new_argc++;
+
if (new_argc == max_new_argc)
{
max_new_argc *= 2;
diff --git a/gnu/usr.bin/cvs/windows-NT/options.h b/gnu/usr.bin/cvs/windows-NT/options.h
index c85e9d7763b..793a8a06c96 100644
--- a/gnu/usr.bin/cvs/windows-NT/options.h
+++ b/gnu/usr.bin/cvs/windows-NT/options.h
@@ -65,7 +65,7 @@
*/
#ifndef DIFF
-#define DIFF "@gdiff_path@"
+#define DIFF "diff"
#endif
/*
@@ -76,7 +76,7 @@
*/
#ifndef GREP
-#define GREP "@ggrep_path@"
+#define GREP "grep"
#endif
/*
@@ -119,6 +119,17 @@
#endif
/*
+ * The password-authenticating server creates a temporary checkout of
+ * the affected files. The variable TMPDIR_DFLT (or even better, the
+ * command-line option "-T" in the line for CVS in /etc/inetd.conf)
+ * can be used to specify the used directory. This directory will
+ * also be used for other temporary files.
+ */
+#ifndef TMPDIR_DFLT
+#define TMPDIR_DFLT "c:\\temp"
+#endif
+
+/*
* The default editor to use, if one does not specify the "-e" option to cvs,
* or does not have an EDITOR environment variable. I set this to just "vi",
* and use the shell to find where "vi" actually is. This allows sites with
@@ -232,16 +243,6 @@
*/
#define AUTH_CLIENT_SUPPORT 1
-/*
- * This tells the client that it must use send()/recv() to talk to the
- * server if it is connected to the server via a socket; Win95 is said to
- * need it because _open_osfhandle doesn't work. This is only
- * implemented for pserver, not rsh. Furthermore, NT doesn't seem to have send()
- * and recv(), or maybe one has to link against a different library or something,
- * I don't know. So this is commented out.
- */
-#define NO_SOCKET_TO_FD 1
-
/* End of CVS configuration section */
/*
diff --git a/gnu/usr.bin/cvs/windows-NT/rcmd.c b/gnu/usr.bin/cvs/windows-NT/rcmd.c
index 7e5ed3d8254..e0f3619ae45 100644
--- a/gnu/usr.bin/cvs/windows-NT/rcmd.c
+++ b/gnu/usr.bin/cvs/windows-NT/rcmd.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <assert.h>
+#include "cvs.h"
#include "rcmd.h"
void
@@ -151,17 +152,17 @@ rcmd_authenticate (int fd, char *locuser, char *remuser, char *command)
server first, but that doesn't seem to work. Transmitting the
client username first does. Go figure. The Linux man pages
get it right --- hee hee. */
- if (write (fd, "0\0", 2) < 0
- || write (fd, locuser, strlen (locuser) + 1) < 0
- || write (fd, remuser, strlen (remuser) + 1) < 0
- || write (fd, command, strlen (command) + 1) < 0)
+ if ((send (fd, "0\0", 2, 0) == SOCKET_ERROR)
+ || (send (fd, locuser, strlen (locuser) + 1, 0) == SOCKET_ERROR)
+ || (send (fd, remuser, strlen (remuser) + 1, 0) == SOCKET_ERROR)
+ || (send (fd, command, strlen (command) + 1, 0) == SOCKET_ERROR))
return -1;
/* They sniff our butt, and send us a '\0' character if they
like us. */
{
char c;
- if (read (fd, &c, 1) <= 0
+ if (recv (fd, &c, 1, 0) == SOCKET_ERROR
|| c != '\0')
{
errno = EPERM;
@@ -182,7 +183,6 @@ rcmd (const char **ahost,
{
struct sockaddr_in sai;
SOCKET s;
- int fd;
assert (fd2p == 0);
@@ -206,14 +206,8 @@ rcmd (const char **ahost,
return -1;
#endif
- /* When using WinSock under Windows NT, sockets are low-level Windows
- NT handles. Turn the socket we've made into a Unix-like file
- descriptor. */
- if ((fd = _open_osfhandle (s, _O_BINARY)) < 0)
+ if (rcmd_authenticate (s, locuser, remuser, cmd) < 0)
return -1;
- if (rcmd_authenticate (fd, locuser, remuser, cmd) < 0)
- return -1;
-
- return fd;
+ return s;
}
diff --git a/gnu/usr.bin/cvs/windows-NT/run.c b/gnu/usr.bin/cvs/windows-NT/run.c
index 777b1521978..e0b01466af2 100644
--- a/gnu/usr.bin/cvs/windows-NT/run.c
+++ b/gnu/usr.bin/cvs/windows-NT/run.c
@@ -211,6 +211,14 @@ run_exec (stin, stout, sterr, flags)
run_print (stderr);
(void) fprintf (stderr, ")\n");
}
+
+ /* Flush standard output and standard error, or otherwise we end
+ up with strange interleavings of stuff called from CYGWIN
+ vs. CMD. */
+
+ fflush (stderr);
+ fflush (stdout);
+
if (noexec && (flags & RUN_REALLY) == 0) /* if in noexec mode */
return (0);
@@ -307,6 +315,13 @@ run_exec (stin, stout, sterr, flags)
(void) close( saerr);
}
+ /* Flush standard output and standard error, or otherwise we end
+ up with strange interleavings of stuff called from CYGWIN
+ vs. CMD. */
+
+ fflush (stderr);
+ fflush (stdout);
+
/* Recognize the return code for an interrupted subprocess. */
if (rval == CONTROL_C_EXIT)
return 2;
diff --git a/gnu/usr.bin/cvs/windows-NT/startserver.c b/gnu/usr.bin/cvs/windows-NT/startserver.c
index e3460d0674b..3de8cca6a7b 100644
--- a/gnu/usr.bin/cvs/windows-NT/startserver.c
+++ b/gnu/usr.bin/cvs/windows-NT/startserver.c
@@ -10,20 +10,6 @@
#include <io.h>
#include <errno.h>
-
-/* Apply the Winsock shutdown function to a CRT file descriptor. */
-static void
-shutdown_fd (int fd, int how)
-{
- SOCKET s;
-
- if ((s = _get_osfhandle (fd)) < 0)
- error (1, errno, "couldn't get socket handle from file descriptor");
- if (shutdown (s, how) == SOCKET_ERROR)
- error (1, 0, "couldn't shut down socket half");
-}
-
-
void
wnt_start_server (int *tofd, int *fromfd,
char *client_user,
@@ -35,7 +21,7 @@ wnt_start_server (int *tofd, int *fromfd,
char *command;
struct servent *sptr;
unsigned short port;
- int read_fd, write_fd;
+ int read_fd;
char *portenv;
if (! (cvs_server = getenv ("CVS_SERVER")))
@@ -61,19 +47,8 @@ wnt_start_server (int *tofd, int *fromfd,
0);
if (read_fd < 0)
error (1, errno, "cannot start server via rcmd");
-
- /* Split the socket into a reading and a writing half. */
- if ((write_fd = dup (read_fd)) < 0)
- error (1, errno, "duplicating server connection");
-#if 0
- /* This ought to be legal, since I've duped it, but shutting
- down the writing end of read_fd seems to terminate the
- whole connection. */
- shutdown_fd (read_fd, 1);
- shutdown_fd (write_fd, 0);
-#endif
-
- *tofd = write_fd;
+
+ *tofd = read_fd;
*fromfd = read_fd;
free (command);
}
@@ -83,9 +58,8 @@ void
wnt_shutdown_server (int fd)
{
SOCKET s;
-
- if ((s = _get_osfhandle (fd)) < 0)
- error (1, errno, "couldn't get handle of server connection");
+
+ s = fd;
if (shutdown (s, 2) == SOCKET_ERROR)
error (1, 0, "couldn't shutdown server connection");
if (closesocket (s) == SOCKET_ERROR)