summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-21 13:37:46 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-21 13:37:46 +0000
commit8e2bfd5962e6318f3bfa8228cd64ad0f77dd304b (patch)
treebdd6ba9f010e5e0b3c5e68472296d09807efbc57
parentf758c43db46239b150b7cd96676b379df6d8c297 (diff)
downloadhercules-8e2bfd5962e6318f3bfa8228cd64ad0f77dd304b.tar.gz
hercules-8e2bfd5962e6318f3bfa8228cd64ad0f77dd304b.tar.bz2
hercules-8e2bfd5962e6318f3bfa8228cd64ad0f77dd304b.tar.xz
hercules-8e2bfd5962e6318f3bfa8228cd64ad0f77dd304b.zip
Fixed a small mistake in r11503 causing a fatal error&exit on unix when you try to do a graceful exit (by ctrl+c for example)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11538 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/common/socket.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index d7fa11684..536d7a200 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/10/21
+ * Fixed a small mistake in r11503 causing a fatal error&exit on unix
+ when you try to do a graceful exit (by ctrl+c for example) [ultramage]
* Removed SC_INCAGIRATE/SC_INCDEXRATE as they are not used anymore.
* Added SC_INCASPDRATE, SC_INCFLEE2, SC_INCCRI, SC_INCDEF, SC_INCBASEATK
and SC_FASTCAST as these are required by the newer items. [Skotlex]
diff --git a/src/common/socket.c b/src/common/socket.c
index ef8e99762..79b95c563 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -551,14 +551,14 @@ int do_sockets(int next)
memcpy(&rfd, &readfds, sizeof(rfd));
ret = select(fd_max, &rfd, NULL, NULL, &timeout);
- if( ret < 0 )
+ if( ret == SOCKET_ERROR )
{
- if( ret != S_EINTR )
+ if( s_errno != S_EINTR )
{
- ShowFatalError("do_sockets: select() returned %d!\n", ret);
+ ShowFatalError("do_sockets: select() failed, error code %d!\n", s_errno);
exit(EXIT_FAILURE);
}
- return 0;
+ return 0; // interrupted by a signal, just loop and try again
}
#ifdef WIN32