Re-applied patch to fix files timestamps changing when seeding. It was removed
in [1425] and sync with libtorrent r1442 didn't fix that issue.
This commit is contained in:
parent
2c7463f9c3
commit
ea2592b42b
@ -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…
x
Reference in New Issue
Block a user