summaryrefslogtreecommitdiff
path: root/src/common
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 /src/common
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
Diffstat (limited to 'src/common')
-rw-r--r--src/common/socket.c8
1 files changed, 4 insertions, 4 deletions
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