From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4240 invoked by alias); 14 Nov 2014 14:31:55 -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 4227 invoked by uid 89); 14 Nov 2014 14:31:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout25.012.net.il Received: from mtaout25.012.net.il (HELO mtaout25.012.net.il) (80.179.55.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Nov 2014 14:31:51 +0000 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NF1004009621C00@mtaout25.012.net.il> for gdb-patches@sourceware.org; Fri, 14 Nov 2014 16:27:25 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NF1004V79HPLL00@mtaout25.012.net.il>; Fri, 14 Nov 2014 16:27:25 +0200 (IST) Date: Fri, 14 Nov 2014 14:31:00 -0000 From: Eli Zaretskii Subject: Re: gnulib's errno module was imported In-reply-to: <546601BD.7020700@redhat.com> To: Pedro Alves Cc: yao@codesourcery.com, gdb-patches@sourceware.org, gregory.0xf0@gmail.com, brobecker@adacore.com Reply-to: Eli Zaretskii Message-id: <83ioihj1kj.fsf@gnu.org> References: <87oasaibe6.fsf@codesourcery.com> <5465EBAD.3070108@redhat.com> <87fvdmhr5o.fsf@codesourcery.com> <546601BD.7020700@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00309.txt.bz2 > Date: Fri, 14 Nov 2014 13:21:01 +0000 > From: Pedro Alves > CC: gdb-patches@sourceware.org, gregory.0xf0@gmail.com, Joel Brobecker > > > @@ -651,6 +652,7 @@ wchar_iterate (struct wchar_iterator *iter, > > switch (errno) > > { > > case EILSEQ: > > + case ENOENT: > > /* Invalid input sequence. We still might have > > converted a character; if so, return it. */ > > if (out_avail < out_request * sizeof (gdb_wchar_t)) > > > > This looks cleaner to me (some comments should be added, of course). > > That was actually my first approach, but then: > > - I thought that having a central place to handle this > and to put the comment was cleaner than repeating the fix > in multiple places. > - That won't build on systems that EILSEQ and ENOENT are > defined to the same value (two switch cases with the same value). > Not sure there are any such systems, but given iconv.h's practice... The last one is easy: case EILSEQ: +#if EILSEQ != ENOENT + case ENOENT: +#endif