ccollect:0.6.2->0.7.0
[nslu2-linux/optware.git] / sources / libtorrent / src-data-socket_file.cc.patch
blob11cc2cad26471f9088a1a3772abc2cd87d000bcd
1 --- src/data/socket_file.cc.orig 2007-07-19 14:23:06.000000000 -0700
2 +++ src/data/socket_file.cc 2007-09-12 16:22:15.000000000 -0700
3 @@ -160,7 +160,14 @@
5 uint64_t align = offset % MemoryChunk::page_size();
7 - char* ptr = (char*)mmap(NULL, length + align, prot, flags, m_fd, offset - align);
8 + offset = offset - align;
10 +#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 3
11 +#warning "swap word of 64-bit offset to work around mmap64 bug of glibc"
12 + offset = (offset >> 32) | (offset << 32);
13 +#endif
15 + char* ptr = (char*)mmap(NULL, length + align, prot, flags, m_fd, offset);
17 if (ptr == MAP_FAILED)
18 return MemoryChunk();