mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
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:
commit
7ae8530a69
@ -645,6 +645,9 @@ vfs_preallocate (int dest_vfs_fd, off_t src_fsize, off_t dest_fsize)
|
|||||||
if (dest_fd == NULL)
|
if (dest_fd == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (src_fsize == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return posix_fallocate (*dest_fd, dest_fsize, src_fsize - dest_fsize);
|
return posix_fallocate (*dest_fd, dest_fsize, src_fsize - dest_fsize);
|
||||||
|
|
||||||
#endif /* HAVE_POSIX_FALLOCATE */
|
#endif /* HAVE_POSIX_FALLOCATE */
|
||||||
|
Loading…
Reference in New Issue
Block a user