aboutsummaryrefslogtreecommitdiff
path: root/src/pq
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-17 03:17:12 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-17 03:17:12 +0100
commit874a69b8f8a31eb5cc608c490478adc57681970b (patch)
tree4d1790c62bde6725adf4380dee4a32a1f75af365 /src/pq
parent8fa757a9418eed2685595227c86c3c34c389adcf (diff)
downloadgnunet-874a69b8f8a31eb5cc608c490478adc57681970b.tar.gz
gnunet-874a69b8f8a31eb5cc608c490478adc57681970b.zip
fix
Diffstat (limited to 'src/pq')
-rw-r--r--src/pq/pq_connect.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index d1b1ee33b..724971bd7 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -194,18 +194,19 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
194 194
195 GNUNET_snprintf (buf, 195 GNUNET_snprintf (buf,
196 sizeof (buf), 196 sizeof (buf),
197 "%s/%u.sql", 197 "%s/%04u.sql",
198 db->load_path, 198 db->load_path,
199 i); 199 i);
200 if (GNUNET_YES != 200 if (GNUNET_YES !=
201 GNUNET_DISK_file_test (buf)) 201 GNUNET_DISK_file_test (buf))
202 break; /* We are done */ 202 break; /* We are done */
203 psql = GNUNET_OS_start_process (GNUNET_NO, 203 psql = GNUNET_OS_start_process (GNUNET_NO,
204 GNUNET_OS_INHERIT_STD_NONE, 204 GNUNET_OS_INHERIT_STD_ALL,
205 NULL, 205 NULL,
206 NULL, 206 NULL,
207 NULL, 207 NULL,
208 "psql", 208 "psql",
209 "psql",
209 db->config_str, 210 db->config_str,
210 "-f", 211 "-f",
211 buf, 212 buf,
@@ -228,9 +229,10 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
228 if ( (GNUNET_OS_PROCESS_EXITED != type) || 229 if ( (GNUNET_OS_PROCESS_EXITED != type) ||
229 (0 != code) ) 230 (0 != code) )
230 { 231 {
231 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, 232 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
232 "psql", 233 "Could not run PSQL on file %s: %d",
233 buf); 234 buf,
235 (int) code);
234 PQfinish (db->conn); 236 PQfinish (db->conn);
235 db->conn = NULL; 237 db->conn = NULL;
236 return; 238 return;