apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@xbc.nu>
Subject Re: Is --enable-utf8 working everywhere?
Date Wed, 17 Jul 2002 01:14:14 GMT
Blair Zajac wrote:

>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.
>

Strictly speaking, Ulrich's patch is better, because there's no 
guarantee that "errno" is a simple global variable. It could be 
translated into a function call, for all you know -- depends on the 
platform, linc implementation, threading support, etc. etc. So making a 
copy makes sense.

>  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.
>

EINVAL is right.



-- 
Brane ─îibej   <brane@xbc.nu>   http://www.xbc.nu/brane/


Mime
View raw message