No subject
Mon Sep 29 12:33:37 2003
Return-Path: xorp-cvs-admin@icir.org
Delivery-Date: Mon, 29 Sep 2003 12:34:06 -0700
Received: from wyvern.icir.org (wyvern.icir.org [192.150.187.14])
by tigger.icir.org (8.12.9p1/8.12.3) with ESMTP id h8TJY6fw081116
for <atanu@tigger.icir.org>; Mon, 29 Sep 2003 12:34:06 -0700 (PDT)
(envelope-from xorp-cvs-admin@icir.org)
Received: from fruitcake.ICSI.Berkeley.EDU (fruitcake.ICSI.Berkeley.EDU [192.150.186.11])
by wyvern.icir.org (8.12.9p1/8.12.3) with ESMTP id h8TJY1H5042626;
Mon, 29 Sep 2003 12:34:01 -0700 (PDT)
(envelope-from xorp-cvs-admin@icir.org)
Received: from fruitcake.ICSI.Berkeley.EDU (localhost [127.0.0.1])
by fruitcake.ICSI.Berkeley.EDU (8.12.9/8.12.9) with ESMTP id h8TJY1wG003174;
Mon, 29 Sep 2003 12:34:01 -0700 (PDT)
Received: from wyvern.icir.org (wyvern.icir.org [192.150.187.14])
by fruitcake.ICSI.Berkeley.EDU (8.12.9/8.12.9) with ESMTP id h8TJXbwG003147
for <xorp-cvs@icsi.berkeley.edu>; Mon, 29 Sep 2003 12:33:37 -0700 (PDT)
Received: from possum.icir.org (possum.icir.org [192.150.187.67])
by wyvern.icir.org (8.12.9p1/8.12.3) with ESMTP id h8TJXbH5042623;
Mon, 29 Sep 2003 12:33:37 -0700 (PDT)
(envelope-from pavlin@possum.icir.org)
Received: from possum.icir.org (localhost [127.0.0.1])
by possum.icir.org (8.12.9p1/8.12.3) with ESMTP id h8TJXbIK058445;
Mon, 29 Sep 2003 12:33:37 -0700 (PDT)
(envelope-from pavlin@possum.icir.org)
Message-Id: <200309291933.h8TJXbIK058445@possum.icir.org>
To: hodson@icir.org
cc: xorp-cvs@icir.org
Subject: Re: [Xorp-cvs] XORP cvs commit: xorp/libxorp/ selector.cc
In-Reply-To: Message from Orion Hodson <hodson@icir.org>
of "Mon, 29 Sep 2003 10:58:16." <200309291758.h8THwG11060605@xorpc.icir.org>
Date: Mon, 29 Sep 2003 12:33:37 -0700
From: Pavlin Radoslavov <pavlin@icir.org>
Sender: xorp-cvs-admin@icir.org
Errors-To: xorp-cvs-admin@icir.org
X-BeenThere: xorp-cvs@icir.org
X-Mailman-Version: 2.0
Precedence: bulk
List-Help: <mailto:xorp-cvs-request@icir.org?subject=help>
List-Post: <mailto:xorp-cvs@icir.org>
List-Subscribe: <http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs>,
<mailto:xorp-cvs-request@icir.org?subject=subscribe>
List-Id: Mailing list for XORP CVS commit messages <xorp-cvs.icir.org>
List-Unsubscribe: <http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs>,
<mailto:xorp-cvs-request@icir.org?subject=unsubscribe>
> CVSROOT: /usr/local/www/data/cvs
> Module name: xorp
> Repository: xorp/libxorp/
> Changes by: hodson@xorpc.icir.org. 03/09/29 10:58:16
>
> Modified files:
> xorp/libxorp/: selector.cc
>
> Log message:
> Remove EINTR handling around select call. We'll see EINTR after a
> signal handler has been invoked. Say we want the signal handler to
> clean up and exit, then the existing code gave a non-deterministic
> opportunity to do so. In an idle eventloop we'd typically be calling
> select with a timeout of zero, get an EINTR, and because of the goto
> do select again with a timeout of zero. Unless the signal handler
> calls exit() we're potentially blocked forever here.
Are you sure we want to completely ignore EINTR?
I appreciate that you found and fixed the select() restarting
problem, but now when I press Ctrl-C, there is a "select failed"
error message that is not needed:
pavlin@possum[532] ./xorp_finder
^CSIGINT received. Exiting.
[ 2003/09/29 12:25:56 ERROR xorp_finder:58186 LIBXORP +228 selector.cc select ] SelectorList::select failed: Interrupted system call
The solution for this is just not to print XLOG_ERROR() in case of
EINTR (see patch below).
Pavlin
Index: selector.cc
===================================================================
RCS file: /usr/local/share/doc/apache/cvs/xorp/libxorp/selector.cc,v
retrieving revision 1.19
diff -c -u -r1.19 selector.cc
--- selector.cc 29 Sep 2003 17:58:15 -0000 1.19
+++ selector.cc 29 Sep 2003 19:23:20 -0000
@@ -224,6 +224,10 @@
case EINVAL:
XLOG_FATAL("Bad select argument (probably timeval)");
break;
+ case EINTR:
+ // The system call was interrupted by a signal, hence return
+ // immediately and enter again the event loop.
+ break;
default:
XLOG_ERROR("SelectorList::select failed: %s", strerror(errno));
break;
_______________________________________________
Xorp-cvs mailing list
Xorp-cvs@icir.org
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs