[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13934 - gnunet/src/datacache
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13934 - gnunet/src/datacache |
Date: |
Sun, 19 Dec 2010 19:27:51 +0100 |
Author: grothoff
Date: 2010-12-19 19:27:51 +0100 (Sun, 19 Dec 2010)
New Revision: 13934
Modified:
gnunet/src/datacache/perf_datacache.c
gnunet/src/datacache/plugin_datacache_sqlite.c
gnunet/src/datacache/test_datacache.c
gnunet/src/datacache/test_datacache_quota.c
Log:
mantis 1627
Modified: gnunet/src/datacache/perf_datacache.c
===================================================================
--- gnunet/src/datacache/perf_datacache.c 2010-12-19 18:22:20 UTC (rev
13933)
+++ gnunet/src/datacache/perf_datacache.c 2010-12-19 18:27:51 UTC (rev
13934)
@@ -131,7 +131,7 @@
int
main (int argc, char *argv[])
{
- const char *pos;
+ char *pos;
char cfg_name[128];
char *const xargv[] = {
"perf-datacache",
@@ -157,10 +157,17 @@
plugin_name = argv[0];
while (NULL != (pos = strstr(plugin_name, "_")))
plugin_name = pos+1;
+ if (NULL != (pos = strstr(plugin_name, ".")))
+ pos[0] = 0;
+ else
+ pos = (char *) plugin_name;
+
GNUNET_snprintf (cfg_name,
sizeof (cfg_name),
"perf_datacache_data_%s.conf",
plugin_name);
+ if (pos != plugin_name)
+ pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
xargv, "perf-datacache", "nohelp",
options, &run, NULL);
Modified: gnunet/src/datacache/plugin_datacache_sqlite.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_sqlite.c 2010-12-19 18:22:20 UTC
(rev 13933)
+++ gnunet/src/datacache/plugin_datacache_sqlite.c 2010-12-19 18:27:51 UTC
(rev 13934)
@@ -424,12 +424,21 @@
struct GNUNET_DATACACHE_PluginFunctions *api = cls;
struct Plugin *plugin = api->cls;
+#if !WINDOWS || defined(__CYGWIN__)
if (0 != UNLINK (plugin->fn))
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"unlink",
plugin->fn);
GNUNET_free (plugin->fn);
+#endif
sqlite3_close (plugin->dbh);
+#if WINDOWS && !defined(__CYGWIN__)
+ if (0 != UNLINK (plugin->fn))
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
+ "unlink",
+ plugin->fn);
+ GNUNET_free (plugin->fn);
+#endif
GNUNET_free (plugin);
GNUNET_free (api);
return NULL;
Modified: gnunet/src/datacache/test_datacache.c
===================================================================
--- gnunet/src/datacache/test_datacache.c 2010-12-19 18:22:20 UTC (rev
13933)
+++ gnunet/src/datacache/test_datacache.c 2010-12-19 18:27:51 UTC (rev
13934)
@@ -130,7 +130,7 @@
int
main (int argc, char *argv[])
{
- const char *pos;
+ char *pos;
char cfg_name[128];
char *const xargv[] = {
"test-datacache",
@@ -156,10 +156,17 @@
plugin_name = argv[0];
while (NULL != (pos = strstr(plugin_name, "_")))
plugin_name = pos+1;
+ if (NULL != (pos = strstr(plugin_name, ".")))
+ pos[0] = 0;
+ else
+ pos = (char *) plugin_name;
+
GNUNET_snprintf (cfg_name,
sizeof (cfg_name),
"test_datacache_data_%s.conf",
plugin_name);
+ if (pos != plugin_name)
+ pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
xargv, "test-datacache", "nohelp",
options, &run, NULL);
Modified: gnunet/src/datacache/test_datacache_quota.c
===================================================================
--- gnunet/src/datacache/test_datacache_quota.c 2010-12-19 18:22:20 UTC (rev
13933)
+++ gnunet/src/datacache/test_datacache_quota.c 2010-12-19 18:27:51 UTC (rev
13934)
@@ -121,7 +121,7 @@
int
main (int argc, char *argv[])
{
- const char *pos;
+ char *pos;
char cfg_name[128];
char *const xargv[] = {
"test-datacache-quota",
@@ -143,14 +143,22 @@
"WARNING",
#endif
NULL);
+
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr(plugin_name, "_")))
plugin_name = pos+1;
+ if (NULL != (pos = strstr(plugin_name, ".")))
+ pos[0] = 0;
+ else
+ pos = (char *) plugin_name;
+
GNUNET_snprintf (cfg_name,
sizeof (cfg_name),
"test_datacache_data_%s.conf",
plugin_name);
+ if (pos != plugin_name)
+ pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
xargv, "test-datacache-quota", "nohelp",
options, &run, NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13934 - gnunet/src/datacache,
gnunet <=