projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7313eb5
)
Make libpq_gettext save and restore errno in a Windows-compatible way.
author
Tom Lane
<
[email protected]
>
Fri, 8 Jul 2005 15:25:36 +0000
(15:25 +0000)
committer
Tom Lane
<
[email protected]
>
Fri, 8 Jul 2005 15:25:36 +0000
(15:25 +0000)
Also, back-patch fix into back branches.
src/interfaces/libpq/fe-misc.c
patch
|
blob
|
blame
|
history
diff --git
a/src/interfaces/libpq/fe-misc.c
b/src/interfaces/libpq/fe-misc.c
index 656c34e8d1d9493c9f576ac7f401a594262eeabd..5639d9d17bef7870ef2f5d7eff26e7a38f1a6a7a 100644
(file)
--- a/
src/interfaces/libpq/fe-misc.c
+++ b/
src/interfaces/libpq/fe-misc.c
@@
-920,8
+920,16
@@
libpq_gettext(const char *msgid)
if (!already_bound)
{
+ /* dgettext() preserves errno, but bindtextdomain() doesn't */
+ int save_errno = errno;
+
already_bound = 1;
bindtextdomain("libpq", LOCALEDIR);
+#ifdef WIN32
+ SetLastError(save_errno);
+#else
+ errno = save_errno;
+#endif
}
return dgettext("libpq", msgid);