Fix libtorrent creating files with no read/write permissions

This commit is contained in:
Andrew Resch 2008-07-15 02:30:23 +00:00
parent 02ce32d5e2
commit 2745bf8536

View File

@ -165,15 +165,18 @@ namespace libtorrent
std::wstring wpath(safe_convert(path.native_file_string()));
m_fd = ::_wopen(
wpath.c_str()
, map_open_mode(mode));
, map_open_mode(mode)
, S_IREAD | S_IWRITE);
#elif defined _WIN32
m_fd = ::_open(
utf8_native(path.native_file_string()).c_str()
, map_open_mode(mode));
, map_open_mode(mode)
, S_IREAD | S_IWRITE);
#else
m_fd = ::open(
utf8_native(path.native_file_string()).c_str()
, map_open_mode(mode));
, map_open_mode(mode)
, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#endif
if (m_fd == -1)
{