From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: EWOULDBLOCK and EINPROGRESS in process.c Date: Tue, 24 Mar 2015 22:25:11 +0100 Message-ID: <87wq2684w8.fsf@igel.home> References: <83sicup8s0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427232352 26192 80.91.229.3 (24 Mar 2015 21:25:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Mar 2015 21:25:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 24 22:25:45 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 1YaWKR-00087d-By for ged-emacs-devel@m.gmane.org; Tue, 24 Mar 2015 22:25:39 +0100 Original-Received: from localhost ([::1]:34622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaWKQ-0000yr-9r for ged-emacs-devel@m.gmane.org; Tue, 24 Mar 2015 17:25:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaWK7-0000xr-Mr for emacs-devel@gnu.org; Tue, 24 Mar 2015 17:25:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaWK6-0006xY-Vw for emacs-devel@gnu.org; Tue, 24 Mar 2015 17:25:19 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.9]:51364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaWK2-0006uK-FK; Tue, 24 Mar 2015 17:25:14 -0400 Original-Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3lBQbF10NNz3hjDv; Tue, 24 Mar 2015 22:25:13 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3lBQbD6j3Lzvh20; Tue, 24 Mar 2015 22:25:12 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id X9as5z6qkj-8; Tue, 24 Mar 2015 22:25:12 +0100 (CET) X-Auth-Info: 0FhoQXkV94cWuQM36YYXsudiHNt3pSPhLCXGFU0yXyLsVIp9ev4YQMuCiV+TfA3r Original-Received: from igel.home (host-188-174-207-62.customer.m-online.net [188.174.207.62]) by mail.mnet-online.de (Postfix) with ESMTPA; Tue, 24 Mar 2015 22:25:12 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 1000) id E0E092C3686; Tue, 24 Mar 2015 22:25:11 +0100 (CET) X-Yow: The appreciation of the average visual graphisticator alone is worth the whole suaveness and decadence which abounds!! In-Reply-To: <83sicup8s0.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Mar 2015 20:09:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 212.18.0.9 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:184185 Archived-At: 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. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."