mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 05:02:31 +00:00
Merge branch 'master' into xirvik
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
AC_INIT(rtorrent, 0.8.9, jaris@ifi.uio.no)
|
||||
|
||||
AC_DEFINE(API_VERSION, 1, api version)
|
||||
AC_DEFINE(API_VERSION, 2, api version)
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
@@ -489,3 +489,22 @@ AC_DEFUN([TORRENT_WITH_XMLRPC_C], [
|
||||
AC_MSG_RESULT(ignored)
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([TORRENT_WITH_INOTIFY], [
|
||||
AC_LANG_PUSH(C++)
|
||||
|
||||
AC_CHECK_HEADERS([sys/inotify.h mcheck.h])
|
||||
AC_MSG_CHECKING([whether sys/inotify.h actually works])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <sys/inotify.h>
|
||||
int main(int,const char*) { return (-1 == inotify_init()); }])
|
||||
],[
|
||||
AC_DEFINE(HAVE_INOTIFY, 1, [sys/inotify.h exists and works correctly])
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(failed)]
|
||||
)
|
||||
|
||||
AC_LANG_POP(C++)
|
||||
])
|
||||
|
||||
@@ -36,10 +36,11 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <ncurses.h>
|
||||
|
||||
#include "input_event.h"
|
||||
|
||||
//ncurses.h must be included last since sys/mman.h on Solaris munges ERR.
|
||||
#include <ncurses.h>
|
||||
|
||||
namespace input {
|
||||
|
||||
void
|
||||
|
||||
+11
-1
@@ -42,7 +42,13 @@
|
||||
#include <rak/path.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/dir.h>
|
||||
|
||||
#ifdef __sun__
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#else
|
||||
#include <sys/dir.h>
|
||||
#endif
|
||||
|
||||
#include "path_input.h"
|
||||
|
||||
@@ -72,7 +78,11 @@ PathInput::pressed(int key) {
|
||||
|
||||
struct _transform_filename {
|
||||
void operator () (utils::directory_entry& entry) {
|
||||
#ifdef __sun__
|
||||
if (entry.d_type & S_IFDIR)
|
||||
#else
|
||||
if (entry.d_type == DT_DIR)
|
||||
#endif
|
||||
entry.d_name += '/';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -88,7 +88,12 @@ SCgi::open_named(const std::string& filename) {
|
||||
char buffer[sizeof(sockaddr_un) + filename.size()];
|
||||
sockaddr_un* sa = reinterpret_cast<sockaddr_un*>(buffer);
|
||||
|
||||
#ifdef __sun__
|
||||
sa->sun_family = AF_UNIX;
|
||||
#else
|
||||
sa->sun_family = AF_LOCAL;
|
||||
#endif
|
||||
|
||||
std::memcpy(sa->sun_path, filename.c_str(), filename.size() + 1);
|
||||
|
||||
if (!get_fd().open_local())
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
#include "rak/error_number.h"
|
||||
#include "signal_handler.h"
|
||||
|
||||
#ifdef __sun__
|
||||
#include <iso/signal_iso.h>
|
||||
//extern "C" void (*signal (int sig, void (*disp)(int)))(int);
|
||||
#endif
|
||||
|
||||
SignalHandler::Slot SignalHandler::m_handlers[HIGHEST_SIGNAL];
|
||||
|
||||
void
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
#include <rak/path.h>
|
||||
#include <torrent/exceptions.h>
|
||||
|
||||
#ifdef __sun__
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "directory.h"
|
||||
|
||||
namespace utils {
|
||||
@@ -69,6 +73,9 @@ Directory::update(int flags) {
|
||||
return false;
|
||||
|
||||
struct dirent* entry;
|
||||
#ifdef __sun__
|
||||
struct stat s;
|
||||
#endif
|
||||
|
||||
while ((entry = readdir(d)) != NULL) {
|
||||
if ((flags & update_hide_dot) && entry->d_name[0] == '.')
|
||||
@@ -76,9 +83,16 @@ Directory::update(int flags) {
|
||||
|
||||
iterator itr = base_type::insert(end(), value_type());
|
||||
|
||||
#ifdef __sun__
|
||||
stat(entry->d_name, &s);
|
||||
itr->d_fileno = entry->d_ino;
|
||||
itr->d_reclen = 0;
|
||||
itr->d_type = s.st_mode;
|
||||
#else
|
||||
itr->d_fileno = entry->d_fileno;
|
||||
itr->d_reclen = entry->d_reclen;
|
||||
itr->d_type = entry->d_type;
|
||||
#endif
|
||||
|
||||
#ifdef DIRENT_NAMLEN_EXISTS_FOOBAR
|
||||
itr->d_name = std::string(entry->d_name, entry->d_name + entry->d_namlen);
|
||||
|
||||
@@ -49,7 +49,7 @@ struct directory_entry {
|
||||
|
||||
// The name and types should match POSIX.
|
||||
uint32_t d_fileno;
|
||||
uint32_t d_reclen;
|
||||
uint32_t d_reclen; //Not used. Messes with Solaris.
|
||||
uint8_t d_type;
|
||||
|
||||
std::string d_name;
|
||||
|
||||
Reference in New Issue
Block a user