gnulib's errno module was imported
Eli Zaretskii
eliz@gnu.org
Fri Nov 14 14:31:00 GMT 2014
> Date: Fri, 14 Nov 2014 13:21:01 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org, gregory.0xf0@gmail.com, Joel Brobecker <brobecker@adacore.com>
>
> > @@ -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
More information about the Gdb-patches
mailing list