Check for free space in the right place for compression and give the right message.

This commit is contained in:
Con Kolivas 2011-03-07 17:00:28 +11:00
parent 7f45a1f024
commit 32e182c95a

4
rzip.c
View file

@ -766,8 +766,8 @@ void rzip_fd(int fd_in, int fd_out)
/* Check if there's enough free space on the device chosen to fit the /* Check if there's enough free space on the device chosen to fit the
* compressed file, based on the compressed file being as large as the * compressed file, based on the compressed file being as large as the
* uncompressed file. */ * uncompressed file. */
if (unlikely(fstatvfs(fd_in, &fbuf))) if (unlikely(fstatvfs(fd_out, &fbuf)))
fatal("Failed to fstatvfs in decompress_file\n"); fatal("Failed to fstatvfs in compress_file\n");
free_space = fbuf.f_bsize * fbuf.f_bavail; free_space = fbuf.f_bsize * fbuf.f_bavail;
if (free_space < control.st_size) { if (free_space < control.st_size) {
if (FORCE_REPLACE) if (FORCE_REPLACE)