File: fix.other.bugs.patch

package info (click to toggle)
cpio 2.13%2Bdfsg-7.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,192 kB
  • sloc: ansic: 43,585; sh: 8,178; yacc: 1,791; makefile: 260; sed: 16
file content (75 lines) | stat: -rw-r--r-- 2,023 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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(-)

diff --git a/lib/rtapelib.c b/lib/rtapelib.c
index f6c4d5e..bd55e0c 100644
--- a/lib/rtapelib.c
+++ b/lib/rtapelib.c
@@ -426,7 +426,9 @@ rmt_open__ (const char *file_name, int open_mode, int bias,
   }
 
   /* 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);
 
diff --git a/lib/sysdep.c b/lib/sysdep.c
index e903032..803afdc 100644
--- a/lib/sysdep.c
+++ b/lib/sysdep.c
@@ -188,4 +188,12 @@ chown ( const char *filename __attribute__ ((unused)) ,  int owner __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
diff --git a/lib/sysdep.h b/lib/sysdep.h
index fd013ff..2709104 100644
--- a/lib/sysdep.h
+++ b/lib/sysdep.h
@@ -21,6 +21,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>
@@ -142,4 +144,4 @@ int link (const char *oldname,const char *newname);
 int chown (const char *filename,int owner,int group);
 #endif
 
-
+#endif
diff --git a/src/main.c b/src/main.c
index b1bc70a..7683500 100644
--- a/src/main.c
+++ b/src/main.c
@@ -777,6 +777,8 @@ main (int argc, char *argv[])
   
   initialize_buffers ();
 
+  SET_BINARY_MODE (1);
+
   (*copy_function) ();
 
   if (archive_des >= 0 && rmtclose (archive_des) == -1)