Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37755702
en ru br
Репозитории ALT
S:2.14.0.4.e3cc-alt1
5.1: 2.10-alt3
4.1: 2.10-alt2.M41.2
4.0: 2.6-alt17.M40.1
3.0: 2.6-alt14
www.altlinux.org/Changes

Другие репозитории

Группа :: Архивирование/Резервное копирование
Пакет: cpio

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: cpio-2.6-alt-newc-crc-hardlinks.patch
Скачать


From b4e0dff8258e29ed2f69a43b6c1dff0a693ee97a Mon Sep 17 00:00:00 2001
From: Dmitry V. Levin <ldv@altlinux.org>
Date: Thu, 19 Nov 2009 22:05:17 +0000
Subject: [PATCH] Fix creation of newc/crc archives with files containing multiple hard links
* 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 23da993..b0b9921 100644
--- a/src/copyout.c
+++ b/src/copyout.c
@@ -108,14 +108,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 new_cpio_header *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;
@@ -135,7 +135,7 @@ count_defered_links_to_dev_ino (struct new_cpio_header *file_hdr)
 static int
 last_link (struct new_cpio_header *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) )
@@ -169,9 +169,9 @@ writeout_other_defers (struct new_cpio_header *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;
@@ -268,7 +268,7 @@ static void
 writeout_final_defers (int out_des)
 {
   struct deferment *d;
-  int other_count;
+  unsigned int other_count;
   while (deferouts != NULL)
     {
       d = deferouts;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin