- (djm) Cygwin fixes from Corinna Vinschen <vinschen@cygnus.com>
diff --git a/ChangeLog b/ChangeLog
index 3ab9070..e9969c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+20000931
+ - (djm) Cygwin fixes from Corinna Vinschen <vinschen@cygnus.com>
+
 20000930
  - (djm) Irix ssh_prng_cmds path fix from Pekka Savola <pekkas@netcore.fi>
  - (djm) Support in bsd-snprintf.c for long long conversions from 
diff --git a/cygwin_util.h b/cygwin_util.h
index efd28bf..bf90d02 100644
--- a/cygwin_util.h
+++ b/cygwin_util.h
@@ -17,7 +17,7 @@
 
 #ifdef HAVE_CYGWIN
 
-int binary_open(const char *filename, int flags, mode_t mode);
+int binary_open(const char *filename, int flags, ...);
 int binary_pipe(int fd[2]);
 int check_nt_auth(int pwd_authenticated, uid_t uid);
 int check_ntsec(const char *filename);
diff --git a/session.c b/session.c
index d0172a3..4463858 100644
--- a/session.c
+++ b/session.c
@@ -1327,11 +1327,13 @@
 					    "Running %.100s add %.100s %.100s %.100s\n",
 					    options.xauth_location, display,
 					    auth_proto, auth_data);
+#ifndef HAVE_CYGWIN /* Unix sockets are not supported */
 					if (screen != NULL)
 						fprintf(stderr,
 						    "Adding %.*s/unix%s %s %s\n",
 						    (int)(screen-display), display,
 						    screen, auth_proto, auth_data);
+#endif
 				}
 				snprintf(cmd, sizeof cmd, "%s -q -",
 				    options.xauth_location);
@@ -1339,10 +1341,12 @@
 				if (f) {
 					fprintf(f, "add %s %s %s\n", display,
 					    auth_proto, auth_data);
+#ifndef HAVE_CYGWIN /* Unix sockets are not supported */
 					if (screen != NULL) 
 						fprintf(f, "add %.*s/unix%s %s %s\n",
 						    (int)(screen-display), display,
 						    screen, auth_proto, auth_data);
+#endif
 					pclose(f);
 				} else {
 					fprintf(stderr, "Could not run %s\n",
diff --git a/ssh.c b/ssh.c
index aff79a5..5188545 100644
--- a/ssh.c
+++ b/ssh.c
@@ -244,7 +244,7 @@
 	original_real_uid = getuid();
 	original_effective_uid = geteuid();
 
-#if !defined(HAVE_SETRLIMIT) || !defined(HAVE_CYGWIN)
+#ifdef HAVE_SETRLIMIT
 	/* If we are installed setuid root be careful to not drop core. */
 	if (original_real_uid != original_effective_uid) {
 		struct rlimit rlim;