From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: EWOULDBLOCK and EINPROGRESS in process.c Date: Wed, 25 Mar 2015 20:13:04 +0200 Message-ID: <83sictndxr.fsf@gnu.org> References: <83sicup8s0.fsf@gnu.org> <87wq2684w8.fsf@igel.home> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1427307223 19651 80.91.229.3 (25 Mar 2015 18:13:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 18:13:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 19:13:34 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Yapo5-00007p-Es for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 19:13:33 +0100 Original-Received: from localhost ([::1]:40680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yapo4-0000Gt-J4 for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 14:13:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yapnq-0000FP-5r for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:13:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yapnl-0000Dm-Qq for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:13:18 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:40218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yapnl-0000DY-IV for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:13:13 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NLS00K004W4UN00@mtaout27.012.net.il> for emacs-devel@gnu.org; Wed, 25 Mar 2015 20:07:57 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLS00J845194720@mtaout27.012.net.il>; Wed, 25 Mar 2015 20:07:57 +0200 (IST) In-reply-to: <87wq2684w8.fsf@igel.home> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.183 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184248 Archived-At: > From: Andreas Schwab > Cc: emacs-devel@gnu.org > Date: Tue, 24 Mar 2015 22:25:11 +0100 > > Eli Zaretskii writes: > > > process.c has this fragment after it calls 'connect': > > > > #ifdef NON_BLOCKING_CONNECT > > #ifdef EINPROGRESS > > if (is_non_blocking_client && xerrno == EINPROGRESS) > > break; > > #else <<<<<<<<<<<<<<<<<<<<<<<<<<<< > > #ifdef EWOULDBLOCK > > if (is_non_blocking_client && xerrno == EWOULDBLOCK) > > break; > > #endif > > #endif > > #endif > > > > Can someone tell why we need that "#else" there? Suppose there's a > > platform that has both values defined, but only returns EWOULDBLOCK > > when a non-blocking 'connect' is called -- that platform will fall > > through the cracks here. > > POSIX only defines EINPROGRESS for this situation, so such a platform > would be buggy. > > > Is there any problem to replace #else with #endif here? > > I don't think it would make any difference in practice. Got it, thanks.