diff -Naur rtorrent-0.8.5/src/input/input_event.cc rtorrent-0.8.5.patched/src/input/input_event.cc --- rtorrent-0.8.5/src/input/input_event.cc 2008-05-07 08:19:11.000000000 -0400 +++ rtorrent-0.8.5.patched/src/input/input_event.cc 2009-10-30 14:55:42.079479468 -0400 @@ -36,10 +36,11 @@ #include "config.h" -#include - #include "input_event.h" +//ncurses.h must be included last since sys/mman.h on Solaris munges ERR. +#include + namespace input { void diff -Naur rtorrent-0.8.5/src/input/path_input.cc rtorrent-0.8.5.patched/src/input/path_input.cc --- rtorrent-0.8.5/src/input/path_input.cc 2008-05-07 08:19:11.000000000 -0400 +++ rtorrent-0.8.5.patched/src/input/path_input.cc 2009-10-29 23:39:43.298862305 -0400 @@ -42,7 +42,13 @@ #include #include -#include + +#ifdef __sun__ + #include + #include +#else + #include +#endif #include "path_input.h" @@ -72,7 +78,11 @@ 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 += '/'; } }; diff -Naur rtorrent-0.8.5/src/rpc/scgi.cc rtorrent-0.8.5.patched/src/rpc/scgi.cc --- rtorrent-0.8.5/src/rpc/scgi.cc 2008-05-07 08:19:10.000000000 -0400 +++ rtorrent-0.8.5.patched/src/rpc/scgi.cc 2009-10-29 23:39:08.723528676 -0400 @@ -88,7 +88,12 @@ char buffer[sizeof(sockaddr_un) + filename.size()]; sockaddr_un* sa = reinterpret_cast(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()) diff -Naur rtorrent-0.8.5/src/signal_handler.cc rtorrent-0.8.5.patched/src/signal_handler.cc --- rtorrent-0.8.5/src/signal_handler.cc 2008-05-07 08:19:11.000000000 -0400 +++ rtorrent-0.8.5.patched/src/signal_handler.cc 2009-10-29 23:46:54.192137524 -0400 @@ -39,6 +39,11 @@ #include #include "signal_handler.h" +#ifdef __sun__ +#include +//extern "C" void (*signal (int sig, void (*disp)(int)))(int); +#endif + SignalHandler::Slot SignalHandler::m_handlers[HIGHEST_SIGNAL]; void diff -Naur rtorrent-0.8.5/src/utils/directory.cc rtorrent-0.8.5.patched/src/utils/directory.cc --- rtorrent-0.8.5/src/utils/directory.cc 2008-05-07 08:19:11.000000000 -0400 +++ rtorrent-0.8.5.patched/src/utils/directory.cc 2009-10-29 23:40:29.464190116 -0400 @@ -42,6 +42,10 @@ #include #include +#ifdef __sun__ +#include +#endif + #include "directory.h" namespace utils { @@ -69,6 +73,9 @@ 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 @@ iterator itr = base_type::insert(end(), value_type()); +#ifdef __sun__ + stat(entry->d_name, &s); + itr->d_fileno = entry->d_ino; + itr->d_type = s.st_mode; +#else itr->d_fileno = entry->d_fileno; - itr->d_reclen = entry->d_reclen; + //itr->d_reclen = entry->d_reclen; //This isn't used and screws up Solaris. + //It's ignore time. 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); diff -Naur rtorrent-0.8.5/src/utils/directory.h rtorrent-0.8.5.patched/src/utils/directory.h --- rtorrent-0.8.5/src/utils/directory.h 2008-05-07 08:19:11.000000000 -0400 +++ rtorrent-0.8.5.patched/src/utils/directory.h 2009-10-29 23:36:59.267512863 -0400 @@ -49,7 +49,7 @@ // 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;