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
4 Exit with an error if end of file is reached. */
7 -disk_fill_input_buffer (int in_des, int num_bytes)
8 +disk_fill_input_buffer (int in_des, off_t num_bytes)
10 in_buff = input_buffer;
11 num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE;
13 When `out_buff' fills up, flush it to file descriptor OUT_DES. */
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)
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. */
23 while (bytes_left > 0)
25 When `out_buff' fills up, flush it to file descriptor OUT_DES. */
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)
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. */
35 while (bytes_left > 0)
37 write_nuls_to_file (long num_bytes, int out_des,
38 void (*writer) (char *in_buf, int out_des, long num_bytes))
46 blocks = num_bytes / 512;
47 extra_bytes = num_bytes % 512;
49 NUM_BYTES is the number of bytes to copy. */
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)
63 NUM_BYTES is the number of bytes to copy. */
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,
75 - long original_num_bytes;
76 + off_t original_num_bytes;
78 original_num_bytes = num_bytes;
81 num_bytes : DISK_IO_BLOCK_SIZE))
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"),
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);
94 NUM_BYTES is the number of bytes to copy. */
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,
103 - long original_num_bytes;
106 + off_t original_num_bytes;
109 original_num_bytes = num_bytes;
110 @@ -520,10 +520,10 @@
111 if (rc = disk_fill_input_buffer (in_des, num_bytes))
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);
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);
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));