mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-05 11:04:42 +03:00
Ticket #2755: cannot copy zero-length files with [Preallocate space] option
If [Preallocate space] option is enabled, MC can't copy zero-length files: "Cannot preallocate space for target file ... Invalid argument (22)" Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
e72a46acf9
commit
49532ac834
@ -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