mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-22 00:56:18 +00:00
* Minor portability fixes.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@638 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -109,7 +109,7 @@ DownloadFactory::receive_load() {
|
|||||||
m_variables.set("tied_to_file", (int64_t)false);
|
m_variables.set("tied_to_file", (int64_t)false);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
m_stream = new std::fstream(rak::path_expand(m_uri).c_str(), std::ios::in);
|
m_stream = new std::fstream(rak::path_expand(m_uri).c_str(), std::ios::in | std::ios::binary);
|
||||||
|
|
||||||
if (m_stream->good())
|
if (m_stream->good())
|
||||||
receive_loaded();
|
receive_loaded();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <rak/algorithm.h>
|
#include <rak/algorithm.h>
|
||||||
#include <rak/file_stat.h>
|
#include <rak/file_stat.h>
|
||||||
|
#include <rak/path.h>
|
||||||
|
|
||||||
#include "path_input.h"
|
#include "path_input.h"
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ struct _transform_filename {
|
|||||||
void operator () (std::string& filename) {
|
void operator () (std::string& filename) {
|
||||||
rak::file_stat fs;
|
rak::file_stat fs;
|
||||||
|
|
||||||
if (!fs.update((m_base + filename)))
|
if (!fs.update(rak::path_expand(m_base + filename)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
else if (fs.is_directory())
|
else if (fs.is_directory())
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ Lockfile::locked_by() const {
|
|||||||
return process_type(std::string(), 0);
|
return process_type(std::string(), 0);
|
||||||
|
|
||||||
char first[256];
|
char first[256];
|
||||||
char* last = first + std::max(read(fd, first, 255), 0);
|
char* last = first + std::max<ssize_t>(read(fd, first, 255), 0);
|
||||||
|
|
||||||
*last = '\0';
|
*last = '\0';
|
||||||
::close(fd);
|
::close(fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user