From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id DFB21385780A for ; Tue, 8 Jun 2021 04:14:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFB21385780A Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D4D51340DA8; Tue, 8 Jun 2021 04:14:37 +0000 (UTC) Date: Tue, 8 Jun 2021 00:14:37 -0400 From: Mike Frysinger To: Eli Zaretskii Cc: tom@tromey.com, gdb-patches@sourceware.org Subject: Re: [PATCH 1/4] gnulib: import chown Message-ID: Mail-Followup-To: Eli Zaretskii , tom@tromey.com, gdb-patches@sourceware.org References: <20210529172510.16285-1-vapier@gentoo.org> <87k0n5n47d.fsf@tromey.com> <83sg1tg2zp.fsf@gnu.org> <83im2pf5n4.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <83im2pf5n4.fsf@gnu.org> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 04:14:50 -0000 On 08 Jun 2021 05:32, Eli Zaretskii wrote: > > Date: Mon, 7 Jun 2021 21:15:36 -0400 > > From: Mike Frysinger > > Cc: Tom Tromey , gdb-patches@sourceware.org > > > > > AFAICT, the Gnulib emulation always returns a failure status in the > > > MinGW port, is that okay for the callers of chown? Perhaps a better > > > alternative is to silently do nothing on MS-Windows? > > > > the calling code can decide how to handle this. using gnulib is still better > > so we don't have to put _WIN32/__MINGW32__/whatever ifdefs everywhere. > > Sure, but won't the calling code need those same #ifdef's you want to > avoid? no, because chown will fail with ENOSYS, and the caller can choose to ignore those instead. > My point is that chown on Windows is largely a no-op, so most callers > will want to silently do nothing rather than always fail. i get that. my point is that we suffer from #ifdef hell and gnulib is providing a way out. the answer isn't to dive right back in. -mike