use NULL value in load_path_suffix to NOT load any files
authorChristian Grothoff <christian@grothoff.org>
Sun, 9 Feb 2020 14:57:39 +0000 (15:57 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sun, 9 Feb 2020 14:57:39 +0000 (15:57 +0100)
src/include/gnunet_container_lib.h
src/include/gnunet_pq_lib.h
src/pq/pq_connect.c

index a119a6632bbdf94ac35788421e4e056530621278..f3325a06450681d82dae5350b44450020dcf63f7 100644 (file)
@@ -789,7 +789,8 @@ typedef int (*GNUNET_CONTAINER_MulitHashMapIteratorCallback) (
  * @return NULL on error
  */
 struct GNUNET_CONTAINER_MultiHashMap *
-GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys);
+GNUNET_CONTAINER_multihashmap_create (unsigned int len,
+                                      int do_not_copy_keys);
 
 
 /**
@@ -800,8 +801,8 @@ GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys);
  * @param map the map
  */
 void
-GNUNET_CONTAINER_multihashmap_destroy (
-  struct GNUNET_CONTAINER_MultiHashMap *map);
+GNUNET_CONTAINER_multihashmap_destroy (struct
+                                       GNUNET_CONTAINER_MultiHashMap *map);
 
 
 /**
index 090e81331bb0f1df11c02f564b5630c059cf66ce..12ec19d7e38b44b57c7f2132b246a29f6efc812a 100644 (file)
@@ -756,7 +756,7 @@ GNUNET_PQ_connect (const char *config_str,
 struct GNUNET_PQ_Context *
 GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg,
                             const char *section,
-                            const char *load_path,
+                            const char *load_path_suffix,
                             const struct GNUNET_PQ_ExecuteStatement *es,
                             const struct GNUNET_PQ_PreparedStatement *ps);
 
index cc064f48d3f58ff2b73c7bf36a69580936bce8d8..6875e9866d8fa9bf2c3669b87e64fb0c48b49f2f 100644 (file)
@@ -317,11 +317,12 @@ GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg,
     conninfo = NULL;
   load_path = NULL;
   sp = NULL;
-  if (GNUNET_OK ==
-      GNUNET_CONFIGURATION_get_value_filename (cfg,
-                                               section,
-                                               "SQL_DIR",
-                                               &sp))
+  if ( (NULL != load_path_suffix) &&
+       (GNUNET_OK ==
+        GNUNET_CONFIGURATION_get_value_filename (cfg,
+                                                 section,
+                                                 "SQL_DIR",
+                                                 &sp)) )
     GNUNET_asprintf (&load_path,
                      "%s%s",
                      sp,