PATCH: fix incorrect total_size value

Gary Fernandez GaryF at livevault.com
Mon Sep 9 12:45:00 EST 2002


I noticed that when doing rsync, sometimes the sizes reported seemed
outrageously large. It turned out that rsync was trying to add the st_size
field for non-regular files. Often this field is -1 (at least for device
files). Here's the patch:

*** patch starts ***

*** flist.c@@/main/original/1 Tue Apr  9 14:02:48 2002
--- flist.c Tue Jun 18 09:40:46 2002
***************
*** 748,754 ****
  		file->basedir = NULL;
  	}
  
! 	if (!S_ISDIR(st.st_mode))
  		stats.total_size += st.st_size;
  
  	return file;
--- 749,755 ----
  		file->basedir = NULL;
  	}
  
! 	if (S_ISREG(st.st_mode))
  		stats.total_size += st.st_size;
  
  	return file;




More information about the rsync mailing list