[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-cpio] [PATCH] Fix creation of newc/crc archives with files containi
From: |
Dmitry V. Levin |
Subject: |
[Bug-cpio] [PATCH] Fix creation of newc/crc archives with files containing multiple hard links |
Date: |
Fri, 20 Nov 2009 03:05:32 +0300 |
* src/copyout.c (count_defered_links_to_dev_ino): Make return type
unsigned. Fix local variable types to match cpio_file_stat members
types.
(last_link): Make link count type unsigned.
(writeout_other_defers): Fix local variable types to match
cpio_file_stat members types.
(writeout_final_defers): Make link count type unsigned.
---
If a hardlink that was going to be archived had an inode number greater
than MAX_INT, it was archived as an empty file.
src/copyout.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/copyout.c b/src/copyout.c
index dd9bac2..22a4313 100644
--- a/src/copyout.c
+++ b/src/copyout.c
@@ -106,14 +106,14 @@ struct deferment *deferouts = NULL;
/* Count the number of other (hard) links to this file that have
already been defered. */
-static int
+static unsigned int
count_defered_links_to_dev_ino (struct cpio_file_stat *file_hdr)
{
struct deferment *d;
- int ino;
- int maj;
- int min;
- int count;
+ ino_t ino;
+ long maj;
+ long min;
+ unsigned int count;
ino = file_hdr->c_ino;
maj = file_hdr->c_dev_maj;
min = file_hdr->c_dev_min;
@@ -133,7 +133,7 @@ count_defered_links_to_dev_ino (struct cpio_file_stat
*file_hdr)
static int
last_link (struct cpio_file_stat *file_hdr)
{
- int other_files_sofar;
+ unsigned int other_files_sofar;
other_files_sofar = count_defered_links_to_dev_ino (file_hdr);
if (file_hdr->c_nlink == (other_files_sofar + 1) )
@@ -167,9 +167,9 @@ writeout_other_defers (struct cpio_file_stat *file_hdr, int
out_des)
{
struct deferment *d;
struct deferment *d_prev;
- int ino;
- int maj;
- int min;
+ ino_t ino;
+ long maj;
+ long min;
ino = file_hdr->c_ino;
maj = file_hdr->c_dev_maj;
min = file_hdr->c_dev_min;
@@ -255,7 +255,7 @@ static void
writeout_final_defers (int out_des)
{
struct deferment *d;
- int other_count;
+ unsigned int other_count;
while (deferouts != NULL)
{
d = deferouts;
--
ldv
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-cpio] [PATCH] Fix creation of newc/crc archives with files containing multiple hard links,
Dmitry V. Levin <=