]> git.pld-linux.org Git - packages/cpio.git/blob - cpio-lfs.patch
2f660d8ea04b86799885a48f13ffe10f428f95ec
[packages/cpio.git] / cpio-lfs.patch
1 --- cpio-2.6/src/util.c.orig    2004-09-08 12:44:49.000000000 +0200
2 +++ cpio-2.6/src/util.c 2005-01-09 02:32:52.642458816 +0100
3 @@ -207,7 +207,7 @@
4     Exit with an error if end of file is reached.  */
5  
6  static int
7 -disk_fill_input_buffer (int in_des, int num_bytes)
8 +disk_fill_input_buffer (int in_des, off_t num_bytes)
9  {
10    in_buff = input_buffer;
11    num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE;
12 @@ -227,9 +227,9 @@
13     When `out_buff' fills up, flush it to file descriptor OUT_DES.  */
14  
15  void
16 -tape_buffered_write (char *in_buf, int out_des, long num_bytes)
17 +tape_buffered_write (char *in_buf, int out_des, off_t num_bytes)
18  {
19 -  register long bytes_left = num_bytes;        /* Bytes needing to be copied.  */
20 +  register off_t bytes_left = num_bytes;       /* Bytes needing to be copied.  */
21    register long space_left;    /* Room left in output buffer.  */
22  
23    while (bytes_left > 0)
24 @@ -254,9 +254,9 @@
25     When `out_buff' fills up, flush it to file descriptor OUT_DES.  */
26  
27  void
28 -disk_buffered_write (char *in_buf, int out_des, long num_bytes)
29 +disk_buffered_write (char *in_buf, int out_des, off_t num_bytes)
30  {
31 -  register long bytes_left = num_bytes;        /* Bytes needing to be copied.  */
32 +  register off_t bytes_left = num_bytes;       /* Bytes needing to be copied.  */
33    register long space_left;    /* Room left in output buffer.  */
34  
35    while (bytes_left > 0)
36 @@ -407,9 +407,9 @@
37  write_nuls_to_file (long num_bytes, int out_des, 
38                      void (*writer) (char *in_buf, int out_des, long num_bytes))
39  {
40 -  long blocks;
41 +  off_t        blocks;
42    long extra_bytes;
43 -  long i;
44 +  off_t        i;
45  
46    blocks = num_bytes / 512;
47    extra_bytes = num_bytes % 512;
48 @@ -428,10 +428,10 @@
49     NUM_BYTES is the number of bytes to copy.  */
50  
51  void
52 -copy_files_tape_to_disk (int in_des, int out_des, long num_bytes)
53 +copy_files_tape_to_disk (int in_des, int out_des, off_t num_bytes)
54  {
55 -  long size;
56 -  long k;
57 +  off_t size;
58 +  off_t k;
59  
60    while (num_bytes > 0)
61      {
62 @@ -458,13 +458,13 @@
63     NUM_BYTES is the number of bytes to copy.  */
64  
65  void
66 -copy_files_disk_to_tape (int in_des, int out_des, long num_bytes,
67 +copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes,
68                          char *filename)
69  {
70 -  long size;
71 -  long k;
72 +  off_t size;
73 +  off_t k;
74    int rc;
75 -  long original_num_bytes;
76 +  off_t original_num_bytes;
77  
78    original_num_bytes = num_bytes;
79  
80 @@ -476,10 +476,10 @@
81           num_bytes : DISK_IO_BLOCK_SIZE))
82           {
83             if (rc > 0)
84 -             error (0, 0, _("File %s shrunk by %ld bytes, padding with zeros"),
85 +             error (0, 0, _("File %s shrunk by %lld bytes, padding with zeros"),
86                                 filename, num_bytes);
87             else
88 -             error (0, 0, _("Read error at byte %ld in file %s, padding with zeros"),
89 +             error (0, 0, _("Read error at byte %lld in file %s, padding with zeros"),
90                         original_num_bytes - num_bytes, filename);
91             write_nuls_to_file (num_bytes, out_des, tape_buffered_write);
92             break;
93 @@ -505,12 +505,12 @@
94     NUM_BYTES is the number of bytes to copy.  */
95  
96  void
97 -copy_files_disk_to_disk (int in_des, int out_des, long num_bytes,
98 +copy_files_disk_to_disk (int in_des, int out_des, off_t num_bytes,
99                          char *filename)
100  {
101 -  long size;
102 -  long k;
103 -  long original_num_bytes;
104 +  off_t size;
105 +  off_t k;
106 +  off_t original_num_bytes;
107    int rc;
108  
109    original_num_bytes = num_bytes;
110 @@ -520,10 +520,10 @@
111         if (rc = disk_fill_input_buffer (in_des, num_bytes))
112           {
113             if (rc > 0)
114 -             error (0, 0, _("File %s shrunk by %ld bytes, padding with zeros"),
115 +             error (0, 0, _("File %s shrunk by %lld bytes, padding with zeros"),
116                                 filename, num_bytes);
117             else
118 -             error (0, 0, _("Read error at byte %ld in file %s, padding with zeros"),
119 +             error (0, 0, _("Read error at byte %lld in file %s, padding with zeros"),
120                         original_num_bytes - num_bytes, filename);
121             write_nuls_to_file (num_bytes, out_des, disk_buffered_write);
122             break;
123 --- cpio-2.6/src/extern.h.lfs   2004-10-14 16:18:34.000000000 -0500
124 +++ cpio-2.6/src/extern.h       2004-10-14 16:20:43.000000000 -0500
125 @@ -161,13 +161,13 @@
126  void tape_empty_output_buffer P_((int out_des));
127  void disk_empty_output_buffer P_((int out_des));
128  void swahw_array P_((char *ptr, int count));
129 -void tape_buffered_write P_((char *in_buf, int out_des, long num_bytes));
130 +void tape_buffered_write P_((char *in_buf, int out_des, off_t num_bytes));
131  void tape_buffered_read P_((char *in_buf, int in_des, long num_bytes));
132  int tape_buffered_peek P_((char *peek_buf, int in_des, int num_bytes));
133  void tape_toss_input P_((int in_des, long num_bytes));
134 -void copy_files_tape_to_disk P_((int in_des, int out_des, long num_bytes));
135 -void copy_files_disk_to_tape P_((int in_des, int out_des, long num_bytes, char *filename));
136 -void copy_files_disk_to_disk P_((int in_des, int out_des, long num_bytes, char *filename));
137 +void copy_files_tape_to_disk P_((int in_des, int out_des, off_t num_bytes));
138 +void copy_files_disk_to_tape P_((int in_des, int out_des, off_t num_bytes, char *filename));
139 +void copy_files_disk_to_disk P_((int in_des, int out_des, off_t num_bytes, char *filename));
140  void warn_if_file_changed P_((char *file_name, unsigned long old_file_size,
141                                unsigned long old_file_mtime));
142  void create_all_directories P_((char *name));
This page took 0.02992 seconds and 2 git commands to generate.