]> granicus.if.org Git - postgresql/commitdiff
Make libpq_gettext save and restore errno in a Windows-compatible way.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 8 Jul 2005 15:24:41 +0000 (15:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 8 Jul 2005 15:24:41 +0000 (15:24 +0000)
Also, back-patch fix into back branches.

src/interfaces/libpq/fe-misc.c

index 6d3b814a9deaad40aa6a98db44c65d29a99ad635..5a0def12f478b3cf4b971870ff9320fdc1daed42 100644 (file)
@@ -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);