aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-02 09:29:26 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-02 09:29:26 +0000
commitc9b161c04b8e6349bc2e2856c2d2d02aa03bb1f0 (patch)
treec811e5277ac56aced1cfba19ede4bf85df07cc64 /src/datastore
parentdc2fdbef104fb5a1aa752fd1d5c9e9ab0992c914 (diff)
downloadgnunet-c9b161c04b8e6349bc2e2856c2d2d02aa03bb1f0.tar.gz
gnunet-c9b161c04b8e6349bc2e2856c2d2d02aa03bb1f0.zip
-fix
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/Makefile.am1
-rw-r--r--src/datastore/plugin_datastore_postgres.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am
index 9443e52be..e7bccbc06 100644
--- a/src/datastore/Makefile.am
+++ b/src/datastore/Makefile.am
@@ -112,6 +112,7 @@ libgnunet_plugin_datastore_postgres_la_SOURCES = \
112 plugin_datastore_postgres.c 112 plugin_datastore_postgres.c
113libgnunet_plugin_datastore_postgres_la_LIBADD = \ 113libgnunet_plugin_datastore_postgres_la_LIBADD = \
114 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 114 $(top_builddir)/src/statistics/libgnunetstatistics.la \
115 $(top_builddir)/src/postgres/libgnunetpostgres.la \
115 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq 116 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
116libgnunet_plugin_datastore_postgres_la_LDFLAGS = \ 117libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
117 $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq 118 $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index bbbbf9534..6dec3146d 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -236,13 +236,18 @@ postgres_plugin_estimate_size (void *cls)
236 { 236 {
237 return 0; 237 return 0;
238 } 238 }
239 if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) || 239 if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) )
240 (PQgetlength (ret, 0, 0) != sizeof (unsigned long long)))
241 { 240 {
242 GNUNET_break (0); 241 GNUNET_break (0);
243 PQclear (ret); 242 PQclear (ret);
244 return 0; 243 return 0;
245 } 244 }
245 if (PQgetlength (ret, 0, 0) != sizeof (unsigned long long))
246 {
247 GNUNET_break (0 == PQgetlength (ret, 0, 0));
248 PQclear (ret);
249 return 0;
250 }
246 total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret, 0, 0)); 251 total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret, 0, 0));
247 PQclear (ret); 252 PQclear (ret);
248 return total; 253 return total;