Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'omp-jb50733' into 'master'
[buteo-mtp] Fix unable of copy big files to SD card over MTP. Fixes JB#50733.

See merge request mer-core/buteo-mtp!33
  • Loading branch information
spiiroin committed Aug 18, 2020
2 parents a11c58d + a060333 commit 731e1a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mts/platform/storage/fsstorageplugin/fsstorageplugin.cpp
Expand Up @@ -2,6 +2,7 @@
* This file is part of libmeegomtp package
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
* Copyright (c) 2020 Open Mobile Platform LLC.
*
* Contact: Deepak Kodihalli <deepak.kodihalli@nokia.com>
*
Expand Down Expand Up @@ -41,6 +42,7 @@
#include <sys/time.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>

#include <QDebug>
#include <QFile>
Expand Down Expand Up @@ -1032,7 +1034,7 @@ MTPResponseCode FSStoragePlugin::createFile( const QString &path, MTPObjectInfo
/* Resize to expected content length */
quint64 size = info ? info->mtpObjectCompressedSize : 0;

if( !file.resize(size) ) {
if( fallocate(file.handle(), 0, 0, size) ) {
MTP_LOG_WARNING("failed to set file:" << path << " to size:" << size);
}

Expand Down

0 comments on commit 731e1a9

Please sign in to comment.