[Freeciv-Dev] (PR#9032) odd "select" error message
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9032 >
> [jdorje - Sat Jun 19 20:37:22 2004]:
>
> When I run autogames I get this message
>
> 1: select failed: Interrupted system call
>
> periodically. This is a recent development.
It's part of a bug in select.
If an error happens, it is logged but execution continues.
First of all, we shouldn't log an EINTR error. This can happen any time
and isn't necessarily an error. In fact none of the other select calls
report errors, so maybe we shouldn't log it at all. Another problem is
EINTR may not be portable; I don't know.
The bug is that if there is an error we can't rely on the values in the
sets (according to "man select"). So we need to return immediately.
jason
? gmon.out
? data/stdfont.ttf
? data/theme
Index: client/clinet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v
retrieving revision 1.99
diff -u -r1.99 clinet.c
--- client/clinet.c 19 May 2004 20:14:26 -0000 1.99
+++ client/clinet.c 24 Jun 2004 13:36:19 -0000
@@ -791,7 +791,10 @@
tv.tv_usec = 0;
if (select(socklan + 1, &readfs, NULL, &exceptfs, &tv) == -1) {
- freelog(LOG_ERROR, "select failed: %s", mystrerror());
+ if (errno != EINTR) {
+ freelog(LOG_ERROR, "select failed: %s", mystrerror());
+ }
+ return lan_servers;
}
if (!FD_ISSET(socklan, &readfs)) {
Index: server/sernet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sernet.c,v
retrieving revision 1.119
diff -u -r1.119 sernet.c
--- server/sernet.c 17 May 2004 02:16:15 -0000 1.119
+++ server/sernet.c 24 Jun 2004 13:36:20 -0000
@@ -980,7 +980,10 @@
tv.tv_usec = 0;
if (select(socklan + 1, &readfs, NULL, &exceptfs, &tv) == -1) {
- freelog(LOG_ERROR, "select failed: %s", mystrerror());
+ if (errno != EINTR) {
+ freelog(LOG_ERROR, "select failed: %s", mystrerror());
+ }
+ return;
}
if (FD_ISSET(socklan, &readfs)) {
|
|