Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91d381e

Browse files
committed
Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
1 parent224501e commit91d381e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/interfaces/libpq/fe-misc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
*
2727
* IDENTIFICATION
28-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65 2001/12/03 00:28:24 tgl Exp $
28+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65.2.1 2005/07/08 15:25:46 tgl Exp $
2929
*
3030
*-------------------------------------------------------------------------
3131
*/
@@ -844,8 +844,16 @@ libpq_gettext(const char *msgid)
844844

845845
if (!already_bound)
846846
{
847+
/* dgettext() preserves errno, but bindtextdomain() doesn't */
848+
intsave_errno=errno;
849+
847850
already_bound=1;
848851
bindtextdomain("libpq",LOCALEDIR);
852+
#ifdefWIN32
853+
SetLastError(save_errno);
854+
#else
855+
errno=save_errno;
856+
#endif
849857
}
850858

851859
returndgettext("libpq",msgid);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp