gnulib's errno module was imported

Yao Qi yao@codesourcery.com
Fri Nov 14 13:02:00 GMT 2014


Pedro Alves <palves@redhat.com> writes:

> I think this will keep haunting and blocking us until we fix it.
>

Let us try again to fix it.

> Can we reevaluate this?

Sure.

> So that leaves handling the case of gnulib making up a EILSEQ value,
> which we take as meaning the system really doesn't really define it,
> which will be the systems GNU iconv returns ENOENT instead.
>
> With that rationale, how about we try something like this?

I am fine with your approach, but I am wondering why don't we simply
check ENOENT in the places where we check EILSEQ?

@@ -513,6 +513,7 @@ convert_between_encodings (const char *from, const char *to,
 	  switch (errno)
 	    {
 	    case EILSEQ:
+	    case ENOENT:
 	      {
 		int i;
 
@@ -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).

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list