Merge branch '2755_zero_length_preallocate'

* 2755_zero_length_preallocate:
  Ticket #2755: cannot copy zero-length files with [Preallocate space] option
This commit is contained in:
Slava Zanko 2012-03-25 15:20:36 +03:00
commit 7ae8530a69

View File

@ -645,6 +645,9 @@ vfs_preallocate (int dest_vfs_fd, off_t src_fsize, off_t dest_fsize)
if (dest_fd == NULL)
return 0;
if (src_fsize == 0)
return 0;
return posix_fallocate (*dest_fd, dest_fsize, src_fsize - dest_fsize);
#endif /* HAVE_POSIX_FALLOCATE */