From: Anibal Monsalve Salazar <anibal@debian.org>
Date: Wed, 20 Nov 2019 13:08:40 -0500
Subject: fix other bugs

---
 lib/rtapelib.c |  2 ++
 lib/sysdep.c   | 10 +++++++++-
 lib/sysdep.h   |  4 +++-
 src/main.c     |  2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

Index: cpio-2.14+dfsg/lib/rtapelib.c
===================================================================
--- cpio-2.14+dfsg.orig/lib/rtapelib.c
+++ cpio-2.14+dfsg/lib/rtapelib.c
@@ -446,7 +446,9 @@ rmt_open__ (const char *file_name, int o
   assume (remote_file);
 
   /* FIXME: Should somewhat validate the decoding, here.  */
+#ifndef __WIN32__
   if (gethostbyname (remote_host) == NULL)
+#endif
     error (EXIT_ON_EXEC_ERROR, 0, _("Cannot connect to %s: resolve failed"),
 	   remote_host);
 
Index: cpio-2.14+dfsg/lib/sysdep.c
===================================================================
--- cpio-2.14+dfsg.orig/lib/sysdep.c
+++ cpio-2.14+dfsg/lib/sysdep.c
@@ -187,4 +187,12 @@ chown ( const char *filename __attribute
   return -1;
 }
 #endif
-
+#ifdef __WIN32__
+# warning "Providing stub placeholder for readlink function"
+int
+readlink ( const char *path __attribute__ ((unused)) ,  char *buf __attribute__ ((unused)) ,  size_t bufsiz __attribute__ ((unused)) )
+{
+  errno = ENOSYS;
+  return -1;
+}
+#endif
Index: cpio-2.14+dfsg/lib/sysdep.h
===================================================================
--- cpio-2.14+dfsg.orig/lib/sysdep.h
+++ cpio-2.14+dfsg/lib/sysdep.h
@@ -20,6 +20,8 @@
    You should have received a copy of the GNU General Public License
    along with GNU cpiio.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifndef LIB_SYSDEP_H
+#define LIB_SYSDEP_H 1
 
 #ifdef HAVE_PROCESS_H
 # include <process.h>
@@ -141,4 +143,4 @@ int link (const char *oldname,const char
 int chown (const char *filename,int owner,int group);
 #endif
 
-
+#endif
Index: cpio-2.14+dfsg/src/main.c
===================================================================
--- cpio-2.14+dfsg.orig/src/main.c
+++ cpio-2.14+dfsg/src/main.c
@@ -786,6 +786,8 @@ main (int argc, char *argv[])
 
   initialize_buffers ();
 
+  SET_BINARY_MODE (1);
+
   (*copy_function) ();
 
   if (archive_des >= 0 && rmtclose (archive_des) == -1)
