Skip to content

Commit 70f7da3

Browse files
committed
Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
1 parent 85f9793 commit 70f7da3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/interfaces/libpq/fe-misc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1994, Regents of the University of California
2424
*
2525
* IDENTIFICATION
26-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.115 2005/07/06 16:25:59 tgl Exp $
26+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.116 2005/07/08 15:24:41 tgl Exp $
2727
*
2828
*-------------------------------------------------------------------------
2929
*/
@@ -1142,7 +1142,11 @@ libpq_gettext(const char *msgid)
11421142
if (!ldir)
11431143
ldir = LOCALEDIR;
11441144
bindtextdomain("libpq", ldir);
1145+
#ifdef WIN32
1146+
SetLastError(save_errno);
1147+
#else
11451148
errno = save_errno;
1149+
#endif
11461150
}
11471151

11481152
return dgettext("libpq", msgid);

0 commit comments

Comments
 (0)