merged minor fix from RC_0_16

This commit is contained in:
Arvid Norberg 2014-02-19 17:26:58 +00:00
parent e94335ec7f
commit 77136592c2
2 changed files with 4 additions and 2 deletions

View File

@ -41,6 +41,8 @@
* fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP
* fix minor lock_files issue on unix
0.16.15 release
* fix mingw time_t 64 bit issue

View File

@ -1145,7 +1145,7 @@ namespace libtorrent
0, // start offset
0, // length (0 = until EOF)
getpid(), // owner
short((mode & write_only) ? F_WRLCK : F_RDLCK), // lock type
short((mode != read_only) ? F_WRLCK : F_RDLCK), // lock type
SEEK_SET // whence
};
if (fcntl(m_fd, F_SETLK, &l) != 0)
@ -1324,7 +1324,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
// the flag
int rw_mode = m_open_mode & rw_mask;
bool use_overlapped = m_open_mode & no_buffer;
if ((rw_mode == read_write || rw_mode == write_only)
if ((rw_mode != read_only)
&& (m_open_mode & sparse)
&& !is_sparse(m_file_handle, use_overlapped))
{