apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r789965 - in /apr/apr/trunk: CHANGES dbd/apr_dbd_pgsql.c
Date Tue, 30 Jun 2009 21:35:27 GMT
Author: bojan
Date: Tue Jun 30 21:35:27 2009
New Revision: 789965

URL: http://svn.apache.org/viewvc?rev=789965&view=rev
Log:
Use locally scoped variables to avoid stomping on return codes.
PR 47431.
Patch by Wayne Jensen <wayne_jensen trendmicro.com>.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/dbd/apr_dbd_pgsql.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=789965&r1=789964&r2=789965&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Tue Jun 30 21:35:27 2009
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) Use locally scoped variables in PostgreSQL driver to avoid stomping
+     on return codes. PR 47431
+     [Wayne Jensen <wayne_jensen trendmicro.com>]
+
   *) On Linux/hppa flock() returns EAGAIN instead of EWOULDBLOCK. This
      causes proc mutex failures.
      [Stefan Fritsch <sf sfritsch.de>]

Modified: apr/apr/trunk/dbd/apr_dbd_pgsql.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/dbd/apr_dbd_pgsql.c?rev=789965&r1=789964&r2=789965&view=diff
==============================================================================
--- apr/apr/trunk/dbd/apr_dbd_pgsql.c (original)
+++ apr/apr/trunk/dbd/apr_dbd_pgsql.c Tue Jun 30 21:35:27 2009
@@ -92,7 +92,7 @@
         if (TXN_IGNORE_ERRORS(sql->trans)) {
             PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -118,7 +118,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -136,7 +136,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "RELEASE SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -162,7 +162,7 @@
         if (TXN_IGNORE_ERRORS(sql->trans)) {
             PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -177,7 +177,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -195,7 +195,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "RELEASE SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -401,7 +401,7 @@
     if (TXN_IGNORE_ERRORS(sql->trans)) {
         PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP");
         if (res) {
-            ret = PQresultStatus(res);
+            int ret = PQresultStatus(res);
             PQclear(res);
             if (!dbd_pgsql_is_success(ret)) {
                 sql->trans->errnum = ret;
@@ -431,7 +431,7 @@
             PGresult *res = PQexec(sql->conn,
                                    "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -449,7 +449,7 @@
             PGresult *res = PQexec(sql->conn,
                                    "RELEASE SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -616,7 +616,7 @@
     if (TXN_IGNORE_ERRORS(sql->trans)) {
         PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP");
         if (res) {
-            ret = PQresultStatus(res);
+            int ret = PQresultStatus(res);
             PQclear(res);
             if (!dbd_pgsql_is_success(ret)) {
                 sql->trans->errnum = ret;
@@ -652,7 +652,7 @@
             PGresult *res = PQexec(sql->conn,
                                    "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -670,7 +670,7 @@
             PGresult *res = PQexec(sql->conn,
                                    "RELEASE SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -772,7 +772,7 @@
         if (TXN_IGNORE_ERRORS(sql->trans)) {
             PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -808,7 +808,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -827,7 +827,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "RELEASE SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -854,7 +854,7 @@
         if (TXN_IGNORE_ERRORS(sql->trans)) {
             PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP");
             if (res) {
-                ret = PQresultStatus(res);
+                int ret = PQresultStatus(res);
                 PQclear(res);
                 if (!dbd_pgsql_is_success(ret)) {
                     sql->trans->errnum = ret;
@@ -878,7 +878,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;
@@ -897,7 +897,7 @@
                 PGresult *res = PQexec(sql->conn,
                                        "RELEASE SAVEPOINT APR_DBD_TXN_SP");
                 if (res) {
-                    ret = PQresultStatus(res);
+                    int ret = PQresultStatus(res);
                     PQclear(res);
                     if (!dbd_pgsql_is_success(ret)) {
                         sql->trans->errnum = ret;



Mime
View raw message