Commit Graph

18 Commits

Author SHA1 Message Date
rakshasa 975d001ea7 Merge branch 'pr/127' 2014-06-18 22:06:37 +09:00
rakshasa 3b39f37f49 C++11 compatibility fixes. 2014-05-13 23:36:37 +09:00
rakshasa 529eda5aab Converted sigc++ slots to std::tr1::function. 2013-08-24 00:14:25 +09:00
Jorge Israel Peña 49d00285c8 added SA_RESTART to automatically restart system calls interrupted by signals (as was already done by signal()) as well as error checking on sigaction() 2013-04-07 21:21:27 -07:00
Jorge Israel Peña 2cd70f4342 replace signal() call with sigaction() for better portability
signal() is known to have portability problems. Some systems such as
old Unix systems and System V employ a behavior in which the signal
disposition is reset to SIG_DFL (default) upon invocation of a signal
handler by the delivery of a signal.

See issue #51 in which Solaris users experience signal-based issues.

Solaris is a system which employs the SIG_DFL reset behavior even in
version 11.1.

See http://docs.oracle.com/cd/E26502_01/html/E29034/signal-3c.html

> If signal() is used, disp is the address of a signal handler, and sig is not SIGILL,
> SIGTRAP, or SIGPWR, the system first sets the signal's disposition to SIG_DFL before
> executing the signal handler.

On Solaris the default signal disposition for SIGUSR1 is to exit the application.

See http://docs.oracle.com/cd/E26502_01/html/E29033/signal.h-3head.html

If I'm correct in assuming this is the problem Solaris users are encountering,
the solution to this (and likely any other portability issues that may arise)
is to use sigaction() which has explicitly defined behavior as per the POSIX standards.

As you can see, it's a pretty drop-in solution. In fact, on some systems such as Linux,
glibc defines signal() as a wrapper around sigaction() to use BSD semantics (i.e. not the
behavior detailed above), which is likely why few others have experienced these problems.

See http://man7.org/linux/man-pages/man2/signal.2.html
2013-04-07 19:41:32 -07:00
rakshasa d1ff1fe77c Solaris compatibility fixes. 2012-03-26 23:18:10 +09:00
rakshasa 4d313e6353 Updated copyright information.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1301 e378c898-3ddf-0310-93e7-cc216c733640
2011-10-09 06:30:14 +00:00
rakshasa a5ed856f01 * Using sigemptyset.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1250 e378c898-3ddf-0310-93e7-cc216c733640
2011-07-20 12:37:27 +00:00
rakshasa 9b0eb94c09 * Added sigset_t type cast.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1249 e378c898-3ddf-0310-93e7-cc216c733640
2011-07-20 12:03:58 +00:00
rakshasa fa8ef65cd7 * Added better handling of SIGBUS, including the error type and fault address in the dump.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1247 e378c898-3ddf-0310-93e7-cc216c733640
2011-07-20 09:57:29 +00:00
rakshasa 220f59ee15 * Tweaked the signals.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1186 e378c898-3ddf-0310-93e7-cc216c733640
2010-11-06 20:00:20 +00:00
rakshasa 535db16850 * Bumping copyright year to 2007.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@938 e378c898-3ddf-0310-93e7-cc216c733640
2007-07-19 21:29:34 +00:00
rakshasa b25af84ee8 * Bumping the copyright year to 2006.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@621 e378c898-3ddf-0310-93e7-cc216c733640
2006-01-10 00:46:50 +00:00
rakshasa b0ac469262 * Removed PeerConnection::m_taskStall, use the keepalive task instead.
* Fixed typo in USE_ALIGNED check.

* Added checks to Tracker* to make sure m_taskTimeout isn't already
inserted.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@534 e378c898-3ddf-0310-93e7-cc216c733640
2005-08-17 19:20:38 +00:00
rakshasa 0588e66eaf Added license exception for linking toward OpenSSL.
Disabled Mozilla's NSS SHA1 code and added OpenSSL SHA1, use NSS if
you need Debian-strict GPL compliance. Added note in README.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@484 e378c898-3ddf-0310-93e7-cc216c733640
2005-07-01 22:41:16 +00:00
rakshasa 2e83af28ac Fixed freebsd compile errors.
Added global rate display.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@463 e378c898-3ddf-0310-93e7-cc216c733640
2005-06-15 09:28:52 +00:00
rakshasa da764db3b9 Adding copyright claim to source files.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@348 e378c898-3ddf-0310-93e7-cc216c733640
2005-03-12 23:30:11 +00:00
rakshasa c3a4a7d554 Signal handler with cleaner shutdown.
Window title and stuff.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@248 e378c898-3ddf-0310-93e7-cc216c733640
2005-01-30 23:10:25 +00:00