From f61d45b9709cd73b56c28776a3527074037ebc2d Mon Sep 17 00:00:00 2001 From: szaka Date: Thu, 15 Jun 2006 18:43:24 +0000 Subject: [PATCH] fix 64 bit destination size calculation on Mac OS X --- ChangeLog | 2 ++ ntfsprogs/ntfsclone.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c7e6ccd..47ecd8ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,6 +50,8 @@ xx/xx/2006 - 1.13.1-WIP - configure.ac fix for Cygwin. (Yuval) - Fix bug with renaming directories with names in DOS and WIN32 namespaces. (Yura) + - ntfsclone: fix 64 bit destination size calculation on Mac OS X + (Mike Bombich, Anton, Szaka) 27/02/2006 - 1.13.0 - Lots and lots and lots of fixes and enhancements. diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index 3b0177f6..2694265c 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -1621,11 +1621,14 @@ static void check_dest_free_space(u64 src_bytes) return; } - dest_bytes = stvfs.f_bsize * stvfs.f_bfree; - + dest_bytes = (u64)stvfs.f_frsize * stvfs.f_bfree; + if (!dest_bytes) + dest_bytes = (u64)stvfs.f_bsize * stvfs.f_bfree; + if (dest_bytes < src_bytes) - err_exit("Destination has no enough free space: %llu MB < %llu" - " MB\n", rounded_up_division(dest_bytes, NTFS_MBYTE), + err_exit("Destination doesn't have enough free space: " + "%llu MB < %llu MB\n", + rounded_up_division(dest_bytes, NTFS_MBYTE), rounded_up_division(src_bytes, NTFS_MBYTE)); }