Ulrich Drepper wrote:
> 
> On Tue, 2002-07-16 at 15:48, Blair Zajac wrote:
> 
> As a real patch use
> 
> --- apr/i18n/unix/xlate.c       Tue Apr 16 15:37:07 2002
> +++ apr/i18n/unix/xlate.c-new   Tue Jul 16 17:21:07 2002
> @@ -255,7 +255,8 @@
>      if (!found) {
>          new->ich = iconv_open(topage, frompage);
>          if (new->ich == (iconv_t)-1) {
> -            return errno;
> +            int e = errno;
> +            return e ? e : EINVAL;
>          }
>          found = 1;
>          check_sbcs(new);

Karl, can you help out here and check in a fix for this?

We don't need to make a copy of errno.  It's not clear to me which
error value we should pick.  Is EINVAL appropriate when the OS
doesn't set errno when it should?  Maybe we should use something
else that signifies we don't know what the real errno is.  The
Solaris man pages for iconv_open() says it can return EMFILE,
ENFILE, ENOMEM and EINVAL.

diff -u -r1.28 xlate.c
--- i18n/unix/xlate.c   15 Jul 2002 19:21:01 -0000      1.28
+++ i18n/unix/xlate.c   17 Jul 2002 00:45:19 -0000
@@ -269,7 +269,7 @@
     if (!found) {
         new->ich = iconv_open(topage, frompage);
         if (new->ich == (iconv_t)-1) {
-            return errno;
+            return errno ? errno : EINVAL;
         }
         found = 1;
         check_sbcs(new);

Best,
Blair

-- 
Blair Zajac <[EMAIL PROTECTED]>
Web and OS performance plots - http://www.orcaware.com/orca/

Reply via email to