]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Save errno around tfind() call.
authorBruno Haible <bruno@clisp.org>
Sun, 14 Oct 2007 16:07:02 +0000 (16:07 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:17 +0000 (12:15 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/dcigettext.c

index 6cf9332705160613210d2d9b43df4d5f0074db87..91012ed76972d80b06b4c6c7a488cba462fa7574 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-14  Bruno Haible  <bruno@clisp.org>
+
+       * dcigettext.c (DCIGETTEXT): Save errno also around the tfind() call.
+       Needed because Interix 3.5 tfind() clobbers errno.
+       Reported by Martin Koeppe <mkoeppe@gmx.de>.
+
 2007-10-13  Bruno Haible  <bruno@clisp.org>
 
        * gettextP.h: Include <bits/libc-lock.h> or lock.h.
@@ -4063,4 +4069,4 @@ Sun Jul  2 02:06:50 1995  Ulrich Drepper  <drepper@myware>
        needed to internationalize own packages.  It provides functions
        which allow to use the X/Open catgets function with an interface
        like the Uniforum gettext function.  For system which does not
-       have neither of those a complete implementation is provided.
+       have neither of those a complete implementation is provided.
\ No newline at end of file
index b172bec276352232df4813c012162cf359aaece9..087835c11c9a551f5a34a76c3f3d88cebf4bc548 100644 (file)
@@ -522,6 +522,9 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
            : n == 1 ? (char *) msgid1 : (char *) msgid2);
 #endif
 
+  /* Preserve the `errno' value.  */
+  saved_errno = errno;
+
   gl_rwlock_rdlock (_nl_state_lock);
 
   /* If DOMAINNAME is NULL, we are interested in the default domain.  If
@@ -592,13 +595,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
        retval = (char *) (*foundp)->translation;
 
       gl_rwlock_unlock (_nl_state_lock);
+      errno = saved_errno;
       return retval;
     }
 #endif
 
-  /* Preserve the `errno' value.  */
-  saved_errno = errno;
-
   /* See whether this is a SUID binary or not.  */
   DETERMINE_SECURE;