- (bal) Applied shutdown() patch for sftp.c by  Corinna Vinschen
   <vinschen@redhat.com>
diff --git a/sftp.c b/sftp.c
index b4775c0..0fba674 100644
--- a/sftp.c
+++ b/sftp.c
@@ -246,11 +246,18 @@
 
 	interactive_loop(in, out);
 
+#if !defined(USE_PIPES)
+        shutdown(in, SHUT_RDWR);
+        shutdown(out, SHUT_RDWR);
+#endif
+
 	close(in);
 	close(out);
 
+#if !defined(HAVE_CYGWIN)
 	if (kill(sshpid, SIGHUP) == -1)
 		fatal("Couldn't terminate ssh process: %s", strerror(errno));
+#endif
 
 	if (waitpid(sshpid, NULL, 0) == -1)
 		fatal("Couldn't wait for ssh process: %s", strerror(errno));