mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 07:02:30 +00:00
* Remove stale lock files if it is held by the same hostname and the
pid is not running. * Added rak::timer::from_seconds(uint32_t) and converted all uses to this to avoid overflows etc. * For each cycle through the tracker list without any successfull connections, increase the timeout by 20 seconds. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@635 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -44,14 +44,18 @@
|
||||
#define RTORRENT_UTILS_LOCKFILE_H
|
||||
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
|
||||
namespace utils {
|
||||
|
||||
class Lockfile {
|
||||
public:
|
||||
typedef std::pair<std::string, pid_t> process_type;
|
||||
|
||||
Lockfile() : m_locked(false) {}
|
||||
|
||||
bool is_locked() const { return m_locked; }
|
||||
bool is_stale();
|
||||
|
||||
// If the path is empty no lock file will be created, although
|
||||
// is_locked() will return true.
|
||||
@@ -61,7 +65,8 @@ public:
|
||||
const std::string& path() const { return m_path; }
|
||||
void set_path(const std::string& path) { m_path = path; }
|
||||
|
||||
std::string locked_by() const;
|
||||
std::string locked_by_as_string() const;
|
||||
process_type locked_by() const;
|
||||
|
||||
private:
|
||||
std::string m_path;
|
||||
|
||||
Reference in New Issue
Block a user