fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 17 Jan 2020 02:17:12 +0000 (03:17 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 17 Jan 2020 02:17:12 +0000 (03:17 +0100)
src/pq/pq_connect.c

index d1b1ee33bff863552a77857dfb1a1b35c76055f4..724971bd77e614c069bbb97bbd445ca330afcb0b 100644 (file)
@@ -194,18 +194,19 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
 
       GNUNET_snprintf (buf,
                        sizeof (buf),
-                       "%s/%u.sql",
+                       "%s/%04u.sql",
                        db->load_path,
                        i);
       if (GNUNET_YES !=
           GNUNET_DISK_file_test (buf))
         break; /* We are done */
       psql = GNUNET_OS_start_process (GNUNET_NO,
-                                      GNUNET_OS_INHERIT_STD_NONE,
+                                      GNUNET_OS_INHERIT_STD_ALL,
                                       NULL,
                                       NULL,
                                       NULL,
                                       "psql",
+                                      "psql",
                                       db->config_str,
                                       "-f",
                                       buf,
@@ -228,9 +229,10 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
       if ( (GNUNET_OS_PROCESS_EXITED != type) ||
            (0 != code) )
       {
-        GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
-                                  "psql",
-                                  buf);
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Could not run PSQL on file %s: %d",
+                    buf,
+                    (int) code);
         PQfinish (db->conn);
         db->conn = NULL;
         return;