bdr: fix: do not use vars named errmsg, generate proper log message
authorChristian Kruse <cjk@defunct.ch>
Fri, 9 May 2014 10:01:59 +0000 (12:01 +0200)
committerAndres Freund <andres@anarazel.de>
Thu, 3 Jul 2014 15:55:32 +0000 (17:55 +0200)
contrib/bdr/bdr.c

index 8b1768bff54af82757363b346dfe1e0c60b7aa84..6e119db9c2314adecbc59a781084516e9c31b5f5 100644 (file)
@@ -785,7 +785,7 @@ bdr_create_con_gucs(char  *name,
                    BdrConnectionConfig **out_config)
 {
    Size        off;
-   char       *errmsg = NULL;
+   char       *errormsg = NULL;
    PQconninfoOption *options;
    PQconninfoOption *cur_option;
    BdrConnectionConfig *opts;
@@ -851,13 +851,14 @@ bdr_create_con_gucs(char  *name,
 
    elog(DEBUG2, "bdr %s: dsn=%s", name, opts->dsn);
 
-   options = PQconninfoParse(opts->dsn, &errmsg);
-   if (errmsg != NULL)
+   options = PQconninfoParse(opts->dsn, &errormsg);
+   if (errormsg != NULL)
    {
-       char       *str = pstrdup(errmsg);
+       char       *str = pstrdup(errormsg);
 
-       PQfreemem(errmsg);
-       elog(ERROR, "msg: %s", str);
+       PQfreemem(errormsg);
+       ereport(ERROR,
+               (errmsg("bdr %s: error in dsn: %s", name, str)));
    }
 
    cur_option = options;