[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: only call PGntuples once
From: |
gnunet |
Subject: |
[gnunet] branch master updated: only call PGntuples once |
Date: |
Sat, 31 Oct 2020 00:19:17 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 778425469 only call PGntuples once
778425469 is described below
commit 77842546903ef7296c863987f9a60e5f0ead14d1
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Oct 31 00:12:01 2020 +0100
only call PGntuples once
---
bin/rename.sh | 2 +-
src/pq/pq_eval.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/bin/rename.sh b/bin/rename.sh
index bf3c767c5..eec77e277 100755
--- a/bin/rename.sh
+++ b/bin/rename.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# This script is in the public domain.
-for n in `find * -name "*.c"` `find * -name "*.h"` `find * -name "*.am"` `find
* -name "*.conf"` `find * -name "*.conf.in"`
+for n in `find * -name "*.c"` `find * -name "*.h"` `find * -name "*.am"` `find
* -name "*.conf"` `find * -name "*.conf.in"`
do
cat $n | sed -e "s/$1/$2/g" > $n.new
mv $n.new $n || echo "Move failed: $n.new to $n"
diff --git a/src/pq/pq_eval.c b/src/pq/pq_eval.c
index 5bcf8ca0e..8d8b5b0f2 100644
--- a/src/pq/pq_eval.c
+++ b/src/pq/pq_eval.c
@@ -263,6 +263,7 @@ GNUNET_PQ_eval_prepared_singleton_select (struct
GNUNET_PQ_Context *db,
{
PGresult *result;
enum GNUNET_DB_QueryStatus qs;
+ int ntuples;
result = GNUNET_PQ_exec_prepared (db,
statement_name,
@@ -277,12 +278,13 @@ GNUNET_PQ_eval_prepared_singleton_select (struct
GNUNET_PQ_Context *db,
PQclear (result);
return qs;
}
- if (0 == PQntuples (result))
+ ntuples = PQntuples (result);
+ if (0 == ntuples)
{
PQclear (result);
return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
}
- if (1 != PQntuples (result))
+ if (1 != ntuples)
{
/* more than one result, but there must be at most one */
GNUNET_break (0);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: only call PGntuples once,
gnunet <=