mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 01:48:40 +00:00
Locally patch libtorrent so it doesn't change files timestamps on each restart
of seeding torrents. See ticket #105 in libtorrent's trac for more details.
This commit is contained in:
parent
71e3e6ea32
commit
ff4dad534f
1 changed files with 11 additions and 5 deletions
|
@ -248,11 +248,17 @@ namespace libtorrent
|
||||||
void set_size(size_type s)
|
void set_size(size_type s)
|
||||||
{
|
{
|
||||||
size_type pos = tell();
|
size_type pos = tell();
|
||||||
seek(s - 1);
|
// Only set size if current file size not equals s.
|
||||||
char dummy = 0;
|
// 2 as "m" argument is to be sure seek() sets SEEK_END on
|
||||||
read(&dummy, 1);
|
// all compilers.
|
||||||
seek(s - 1);
|
if(s != seek(0, 2))
|
||||||
write(&dummy, 1);
|
{
|
||||||
|
seek(s - 1);
|
||||||
|
char dummy = 0;
|
||||||
|
read(&dummy, 1);
|
||||||
|
seek(s - 1);
|
||||||
|
write(&dummy, 1);
|
||||||
|
}
|
||||||
seek(pos);
|
seek(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue