]> git.pld-linux.org Git - packages/postgresql.git/commitdiff
- updated for 8.2.5 auto/th/postgresql-8_2_5-1
authorradek <radek@pld-linux.org>
Tue, 18 Sep 2007 22:02:14 +0000 (22:02 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    postgresql-pg_ctl-fix.patch -> 1.2

postgresql-pg_ctl-fix.patch

index 912e9c634619b2ffb31bca081d77f132eede3d1f..4d52254f126f9158014610ae2a5f5f63fa18199b 100644 (file)
@@ -1,18 +1,28 @@
---- src/bin/pg_ctl/pg_ctl.c.orig       2006-04-04 15:52:48.000000000 +0000
-+++ src/bin/pg_ctl/pg_ctl.c    2006-04-04 16:43:27.000000000 +0000
-@@ -373,9 +373,11 @@
+--- postgresql-8.2.5/src/bin/pg_ctl/pg_ctl.c.orig      2007-09-18 22:08:39.757996485 +0100
++++ postgresql-8.2.5/src/bin/pg_ctl/pg_ctl.c   2007-09-18 22:43:12.441795575 +0100
+@@ -19,6 +19,7 @@
+ #include "postgres_fe.h"
+ #include "libpq-fe.h"
++#include "pg_config_manual.h"
+ #include <locale.h>
+ #include <signal.h>
+@@ -404,10 +405,12 @@
        bool            success = false;
        int                     i;
        char            portstr[32];
-+      char            sockstr[256];
++      char            sockstr[MAXPGPATH];
        char       *p;
+-      char            connstr[128]; /* Should be way more than enough! */
++      char            connstr[MAXPGPATH+128];
  
        *portstr = '\0';
-+      *sockstr = '\0';
++      *sockstr = '\0';
  
        /* post_opts */
        for (p = post_opts; *p;)
-@@ -400,7 +402,7 @@
+@@ -432,7 +435,7 @@
        }
  
        /* config file */
@@ -21,7 +31,7 @@
        {
                char      **optlines;
  
-@@ -413,18 +415,32 @@
+@@ -445,18 +448,32 @@
  
                                while (isspace((unsigned char) *p))
                                        p++;
@@ -34,7 +44,7 @@
 -                                      continue;
 -                              p++;
 -                              while (isspace((unsigned char) *p))
-+                              if (strncmp(p, "port", strlen("port")) == 0)
++                              if (!*portstr && strncmp(p, "port", strlen("port")) == 0)
 +                              {
 +                                      p += strlen("port");
 +                                      while (isspace((unsigned char) *p))
@@ -48,7 +58,7 @@
 +                                      StrNCpy(portstr, p, Min(strcspn(p, "#" WHITESPACE) + 1,
                                                                                sizeof(portstr)));
 +                              }
-+                              if (strncmp(p, "unix_socket_directory", strlen("unix_socket_directory")) == 0)
++                              if (!*sockstr && strncmp(p, "unix_socket_directory", strlen("unix_socket_directory")) == 0)
 +                              {
 +                                      p += strlen("unix_socket_directory");
 +                                      while (isspace((unsigned char) *p))
                                /* keep looking, maybe there is another */
                        }
                }
-@@ -440,7 +456,7 @@
+@@ -473,6 +490,12 @@
+       /* We need to set a connect timeout otherwise on Windows the SCM will probably timeout first */
+       snprintf(connstr, sizeof(connstr), "dbname=postgres port=%s connect_timeout=5", portstr);
  
++      /* path to directory containing the unix socket */
++      if (*sockstr) {
++              strncat(connstr, " host=", sizeof(connstr) - strlen(connstr));
++              strncat(connstr, sockstr,  sizeof(connstr) - strlen(connstr));
++      }
++
        for (i = 0; i < wait_seconds; i++)
        {
--              if ((conn = PQsetdbLogin(NULL, portstr, NULL, NULL,
-+              if ((conn = PQsetdbLogin((!*sockstr ? NULL : sockstr), portstr, NULL, NULL,
-                                                                "postgres", NULL, NULL)) != NULL &&
-                       (PQstatus(conn) == CONNECTION_OK ||
-                        (strcmp(PQerrorMessage(conn),
+               if ((conn = PQconnectdb(connstr)) != NULL &&
This page took 0.213739 seconds and 4 git commands to generate.