mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(vfs_preallocate): check mc_global.vfs.preallocate_space before call.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
357711da33
commit
88d6157323
@ -650,9 +650,6 @@ vfs_preallocate (int dest_vfs_fd, off_t src_fsize, off_t dest_fsize)
|
|||||||
void *dest_fd = NULL;
|
void *dest_fd = NULL;
|
||||||
struct vfs_class *dest_class;
|
struct vfs_class *dest_class;
|
||||||
|
|
||||||
if (!mc_global.vfs.preallocate_space)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (src_fsize == 0)
|
if (src_fsize == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -2367,7 +2367,8 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* try preallocate space; if fail, try copy anyway */
|
/* try preallocate space; if fail, try copy anyway */
|
||||||
while (vfs_preallocate (dest_desc, file_size, appending ? dst_stat.st_size : 0) != 0)
|
while (mc_global.vfs.preallocate_space &&
|
||||||
|
vfs_preallocate (dest_desc, file_size, appending ? dst_stat.st_size : 0) != 0)
|
||||||
{
|
{
|
||||||
if (ctx->skip_all)
|
if (ctx->skip_all)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user