From 8e2bfd5962e6318f3bfa8228cd64ad0f77dd304b Mon Sep 17 00:00:00 2001 From: ultramage Date: Sun, 21 Oct 2007 13:37:46 +0000 Subject: 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 --- Changelog-Trunk.txt | 2 ++ src/common/socket.c | 8 ++++---- 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 -- cgit v1.2.3-60-g2f50