Sergey,
please consider applying these patches:
$ dd if=/dev/zero of=/tmp/big bs=1M count=4500
$ find /tmp/big | ./cpio -o > archiv.cpio
cpio: File /tmp/big grew, 0 new bytes not copied
827393 blocks
after patch cpio-largeFileGrew.patch is applied
$ find /tmp/big | ./cpio -o > archiv.cpio
./cpio: /tmp/big: field width not sufficient for storing file size
1 block
$ echo $?
0
after patch cpio-toAsciiError.patch is applied
$ find /tmp/big | ./cpio -o > archiv.cpio
./cpio: /tmp/big: field width not sufficient for storing file size
$ echo $?
1
and that seems to be alright for me.
cpio was compiled on i386 with -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE
--- cpio/src/cpiohdr.h.largeFileGrew 2006-03-14 15:05:41.000000000 -0500
+++ cpio/src/cpiohdr.h 2006-03-14 15:06:21.000000000 -0500
@@ -77,7 +77,7 @@
unsigned long c_gid;
unsigned long c_nlink;
unsigned long c_mtime;
- unsigned long c_filesize;
+ off_t c_filesize;
long c_dev_maj;
long c_dev_min;
long c_rdev_maj;
--- cpio/src/extern.h.largeFileGrew 2006-03-14 15:06:34.000000000 -0500
+++ cpio/src/extern.h 2006-03-14 15:06:58.000000000 -0500
@@ -164,7 +164,7 @@
void copy_files_tape_to_disk (int in_des, int out_des, off_t num_bytes);
void copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes, char *filename);
void copy_files_disk_to_disk (int in_des, int out_des, off_t num_bytes, char *filename);
-void warn_if_file_changed (char *file_name, unsigned long old_file_size,
+void warn_if_file_changed (char *file_name, off_t old_file_size,
unsigned long old_file_mtime);
void create_all_directories (char *name);
void prepare_append (int out_file_des);
--- cpio/src/util.c.largeFileGrew 2006-03-14 15:07:15.000000000 -0500
+++ cpio/src/util.c 2006-03-14 15:07:40.000000000 -0500
@@ -552,7 +552,7 @@
/* Warn if file changed while it was being copied. */
void
-warn_if_file_changed (char *file_name, unsigned long old_file_size,
+warn_if_file_changed (char *file_name, off_t old_file_size,
unsigned long old_file_mtime)
{
struct stat new_file_stat;
--- cpio/src/copyout.c.toAsciiError 2006-03-14 15:09:52.000000000 -0500
+++ cpio/src/copyout.c 2006-03-14 15:10:51.000000000 -0500
@@ -299,7 +299,7 @@
static void
field_width_error (const char *filename, const char *fieldname)
{
- error (0, 0, _("%s: field width not sufficient for storing %s"),
+ error (1, 0, _("%s: field width not sufficient for storing %s"),
filename, fieldname);
}
_______________________________________________
Bug-cpio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-cpio