mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +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)
|
||||
return 0;
|
||||
|
||||
if (src_fsize == 0)
|
||||
return 0;
|
||||
|
||||
return posix_fallocate (*dest_fd, dest_fsize, src_fsize - dest_fsize);
|
||||
|
||||
#endif /* HAVE_POSIX_FALLOCATE */
|
||||
|
Loading…
Reference in New Issue
Block a user