|
|
|
@ -188,7 +188,7 @@ namespace libtorrent
@@ -188,7 +188,7 @@ namespace libtorrent
|
|
|
|
|
if (_stati64(f.c_str(), &ret) < 0) |
|
|
|
|
#endif |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
@ -200,7 +200,7 @@ namespace libtorrent
@@ -200,7 +200,7 @@ namespace libtorrent
|
|
|
|
|
retval = ::stat(f.c_str(), &ret); |
|
|
|
|
if (retval < 0) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
#endif // TORRENT_WINDOWS
|
|
|
|
@ -239,7 +239,7 @@ namespace libtorrent
@@ -239,7 +239,7 @@ namespace libtorrent
|
|
|
|
|
if (::rename(f1.c_str(), f2.c_str()) < 0) |
|
|
|
|
#endif |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -279,7 +279,7 @@ namespace libtorrent
@@ -279,7 +279,7 @@ namespace libtorrent
|
|
|
|
|
#else |
|
|
|
|
int ret = mkdir(n.c_str(), 0777); |
|
|
|
|
if (ret < 0 && errno != EEXIST) |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -335,13 +335,13 @@ namespace libtorrent
@@ -335,13 +335,13 @@ namespace libtorrent
|
|
|
|
|
// this only works on 10.5
|
|
|
|
|
copyfile_state_t state = copyfile_state_alloc(); |
|
|
|
|
if (copyfile(f1.c_str(), f2.c_str(), state, COPYFILE_ALL) < 0) |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
copyfile_state_free(state); |
|
|
|
|
#else |
|
|
|
|
int infd = ::open(inf.c_str(), O_RDONLY); |
|
|
|
|
if (infd < 0) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -355,7 +355,7 @@ namespace libtorrent
@@ -355,7 +355,7 @@ namespace libtorrent
|
|
|
|
|
if (outfd < 0) |
|
|
|
|
{ |
|
|
|
|
close(infd); |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
char buffer[4096]; |
|
|
|
@ -365,13 +365,13 @@ namespace libtorrent
@@ -365,13 +365,13 @@ namespace libtorrent
|
|
|
|
|
if (num_read == 0) break; |
|
|
|
|
if (num_read < 0) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
int num_written = write(outfd, buffer, num_read); |
|
|
|
|
if (num_written < num_read) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (num_read < int(sizeof(buffer))) break; |
|
|
|
@ -699,7 +699,7 @@ namespace libtorrent
@@ -699,7 +699,7 @@ namespace libtorrent
|
|
|
|
|
std::string f = convert_to_native(inf); |
|
|
|
|
if (::remove(f.c_str()) < 0) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
#endif // TORRENT_WINDOWS
|
|
|
|
@ -792,7 +792,7 @@ namespace libtorrent
@@ -792,7 +792,7 @@ namespace libtorrent
|
|
|
|
|
m_handle = opendir(p.c_str()); |
|
|
|
|
if (m_handle == 0) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
m_done = true; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -844,7 +844,7 @@ namespace libtorrent
@@ -844,7 +844,7 @@ namespace libtorrent
|
|
|
|
|
dirent* dummy; |
|
|
|
|
if (readdir_r(m_handle, &m_dirent, &dummy) != 0) |
|
|
|
|
{ |
|
|
|
|
ec.assign(errno, boost::system::get_generic_category()); |
|
|
|
|
ec.assign(errno, boost::system::generic_category()); |
|
|
|
|
m_done = true; |
|
|
|
|
} |
|
|
|
|
if (dummy == 0) m_done = true; |
|
|
|
|