diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-08 15:24:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-08 15:24:41 +0000 |
commit | 70f7da3e6ec865a120f3a3fed6173ce20f7d485a (patch) | |
tree | d78d398f74997d016f9b835096a3d2348129e388 /src | |
parent | 85f97937d2be78d89e8f4718621468c58a2a2d7c (diff) | |
download | postgresql-70f7da3e6ec865a120f3a3fed6173ce20f7d485a.tar.gz postgresql-70f7da3e6ec865a120f3a3fed6173ce20f7d485a.zip |
Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/libpq/fe-misc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 6d3b814a9de..5a0def12f47 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -23,7 +23,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.115 2005/07/06 16:25:59 tgl Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.116 2005/07/08 15:24:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1142,7 +1142,11 @@ libpq_gettext(const char *msgid) if (!ldir) ldir = LOCALEDIR; bindtextdomain("libpq", ldir); +#ifdef WIN32 + SetLastError(save_errno); +#else errno = save_errno; +#endif } return dgettext("libpq", msgid); |