From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130824 invoked by alias); 20 Sep 2017 22:44:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 130813 invoked by uid 89); 20 Sep 2017 22:43:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1478 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Sep 2017 22:43:58 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAEDAC0587C5 for ; Wed, 20 Sep 2017 22:43:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BAEDAC0587C5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F3D5600CA; Wed, 20 Sep 2017 22:43:54 +0000 (UTC) Subject: Re: [PATCH v2 1/5] Import "glob" and "getcwd" modules from gnulib To: Sergio Durigan Junior References: <20170912042325.14927-1-sergiodj@redhat.com> <20170919042842.9210-1-sergiodj@redhat.com> <87y3pbwbgl.fsf@redhat.com> <0f9f2e47-dc17-0bd8-5445-0cf40160929e@redhat.com> <8760cdp9w7.fsf@redhat.com> <87shfhnrwp.fsf@redhat.com> <87shfhdsel.fsf@redhat.com> Cc: GDB Patches From: Pedro Alves Message-ID: <4dd4a416-7381-a556-1770-a636df65fe8a@redhat.com> Date: Wed, 20 Sep 2017 22:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87shfhdsel.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00522.txt.bz2 On 09/20/2017 09:30 PM, Sergio Durigan Junior wrote: > On Wednesday, September 20 2017, I wrote: > >> On Wednesday, September 20 2017, Pedro Alves wrote: >> >>> This is all wrapped in #ifdef WINDOWS_SOCKETS, hence the question. >>> >>> It should be easy for you to determine whether WINDOWS_SOCKETS >>> is defined in your mingw build, and thus whether all this code >>> is part of the build or not. >> >> I will do that and report back. Thanks, > > WINDOWS_SOCKETS is not defined when building with the mingw compiler > from Fedora. This means that removing that "#define" was actually not > correct, because "close" will not work as expected even with gnulib. Looks like it's defined by gnulib/m4/socketlib.m4, and seemingly we're not pulling in that module. > > My proposal is to define "close" as it was being defined before, but > actually "#undef" it if it's already defined by other headers, like: > > #ifdef close > #undef close > #endif > #define close(fd) closesocket (fd) > > Does that work for you? > (There's no need of wrap #undef with #ifdef/#endif. That's redundant.) That'd #undef 'close' on all hosts, even if gnulib decides to replace it for some reason. E.g., REPLACE_FCHDIR check in rpl_close (see my previous email). How about we switch close/closesocket around: #ifndef USE_WIN32API # define closesocket close #endif And then use closesocket instead of close? Thanks, Pedro Alves