diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-12-19 18:27:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-12-19 18:27:51 +0000 |
commit | 6652156e7d7083205b68d5fc73a085b88e662d96 (patch) | |
tree | 546b23e0ae412c947da65df4a7ec0b8f73be0d92 /src/datacache | |
parent | 15de71a29f22caee6b15956b162e1e5a0f5f4f3e (diff) | |
download | gnunet-6652156e7d7083205b68d5fc73a085b88e662d96.tar.gz gnunet-6652156e7d7083205b68d5fc73a085b88e662d96.zip |
mantis 1627
Diffstat (limited to 'src/datacache')
-rw-r--r-- | src/datacache/perf_datacache.c | 9 | ||||
-rw-r--r-- | src/datacache/plugin_datacache_sqlite.c | 9 | ||||
-rw-r--r-- | src/datacache/test_datacache.c | 9 | ||||
-rw-r--r-- | src/datacache/test_datacache_quota.c | 10 |
4 files changed, 34 insertions, 3 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index f32574019..ff60a58a4 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c | |||
@@ -131,7 +131,7 @@ FAILURE: | |||
131 | int | 131 | int |
132 | main (int argc, char *argv[]) | 132 | main (int argc, char *argv[]) |
133 | { | 133 | { |
134 | const char *pos; | 134 | char *pos; |
135 | char cfg_name[128]; | 135 | char cfg_name[128]; |
136 | char *const xargv[] = { | 136 | char *const xargv[] = { |
137 | "perf-datacache", | 137 | "perf-datacache", |
@@ -157,10 +157,17 @@ main (int argc, char *argv[]) | |||
157 | plugin_name = argv[0]; | 157 | plugin_name = argv[0]; |
158 | while (NULL != (pos = strstr(plugin_name, "_"))) | 158 | while (NULL != (pos = strstr(plugin_name, "_"))) |
159 | plugin_name = pos+1; | 159 | plugin_name = pos+1; |
160 | if (NULL != (pos = strstr(plugin_name, "."))) | ||
161 | pos[0] = 0; | ||
162 | else | ||
163 | pos = (char *) plugin_name; | ||
164 | |||
160 | GNUNET_snprintf (cfg_name, | 165 | GNUNET_snprintf (cfg_name, |
161 | sizeof (cfg_name), | 166 | sizeof (cfg_name), |
162 | "perf_datacache_data_%s.conf", | 167 | "perf_datacache_data_%s.conf", |
163 | plugin_name); | 168 | plugin_name); |
169 | if (pos != plugin_name) | ||
170 | pos[0] = '.'; | ||
164 | GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, | 171 | GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, |
165 | xargv, "perf-datacache", "nohelp", | 172 | xargv, "perf-datacache", "nohelp", |
166 | options, &run, NULL); | 173 | options, &run, NULL); |
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c index b5d0ea715..e3f0dcb24 100644 --- a/src/datacache/plugin_datacache_sqlite.c +++ b/src/datacache/plugin_datacache_sqlite.c | |||
@@ -424,12 +424,21 @@ libgnunet_plugin_datacache_sqlite_done (void *cls) | |||
424 | struct GNUNET_DATACACHE_PluginFunctions *api = cls; | 424 | struct GNUNET_DATACACHE_PluginFunctions *api = cls; |
425 | struct Plugin *plugin = api->cls; | 425 | struct Plugin *plugin = api->cls; |
426 | 426 | ||
427 | #if !WINDOWS || defined(__CYGWIN__) | ||
427 | if (0 != UNLINK (plugin->fn)) | 428 | if (0 != UNLINK (plugin->fn)) |
428 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, | 429 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, |
429 | "unlink", | 430 | "unlink", |
430 | plugin->fn); | 431 | plugin->fn); |
431 | GNUNET_free (plugin->fn); | 432 | GNUNET_free (plugin->fn); |
433 | #endif | ||
432 | sqlite3_close (plugin->dbh); | 434 | sqlite3_close (plugin->dbh); |
435 | #if WINDOWS && !defined(__CYGWIN__) | ||
436 | if (0 != UNLINK (plugin->fn)) | ||
437 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, | ||
438 | "unlink", | ||
439 | plugin->fn); | ||
440 | GNUNET_free (plugin->fn); | ||
441 | #endif | ||
433 | GNUNET_free (plugin); | 442 | GNUNET_free (plugin); |
434 | GNUNET_free (api); | 443 | GNUNET_free (api); |
435 | return NULL; | 444 | return NULL; |
diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c index b626ce67d..7d55ef8b7 100644 --- a/src/datacache/test_datacache.c +++ b/src/datacache/test_datacache.c | |||
@@ -130,7 +130,7 @@ FAILURE: | |||
130 | int | 130 | int |
131 | main (int argc, char *argv[]) | 131 | main (int argc, char *argv[]) |
132 | { | 132 | { |
133 | const char *pos; | 133 | char *pos; |
134 | char cfg_name[128]; | 134 | char cfg_name[128]; |
135 | char *const xargv[] = { | 135 | char *const xargv[] = { |
136 | "test-datacache", | 136 | "test-datacache", |
@@ -156,10 +156,17 @@ main (int argc, char *argv[]) | |||
156 | plugin_name = argv[0]; | 156 | plugin_name = argv[0]; |
157 | while (NULL != (pos = strstr(plugin_name, "_"))) | 157 | while (NULL != (pos = strstr(plugin_name, "_"))) |
158 | plugin_name = pos+1; | 158 | plugin_name = pos+1; |
159 | if (NULL != (pos = strstr(plugin_name, "."))) | ||
160 | pos[0] = 0; | ||
161 | else | ||
162 | pos = (char *) plugin_name; | ||
163 | |||
159 | GNUNET_snprintf (cfg_name, | 164 | GNUNET_snprintf (cfg_name, |
160 | sizeof (cfg_name), | 165 | sizeof (cfg_name), |
161 | "test_datacache_data_%s.conf", | 166 | "test_datacache_data_%s.conf", |
162 | plugin_name); | 167 | plugin_name); |
168 | if (pos != plugin_name) | ||
169 | pos[0] = '.'; | ||
163 | GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, | 170 | GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, |
164 | xargv, "test-datacache", "nohelp", | 171 | xargv, "test-datacache", "nohelp", |
165 | options, &run, NULL); | 172 | options, &run, NULL); |
diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c index 77ad63815..d956ac36f 100644 --- a/src/datacache/test_datacache_quota.c +++ b/src/datacache/test_datacache_quota.c | |||
@@ -121,7 +121,7 @@ FAILURE: | |||
121 | int | 121 | int |
122 | main (int argc, char *argv[]) | 122 | main (int argc, char *argv[]) |
123 | { | 123 | { |
124 | const char *pos; | 124 | char *pos; |
125 | char cfg_name[128]; | 125 | char cfg_name[128]; |
126 | char *const xargv[] = { | 126 | char *const xargv[] = { |
127 | "test-datacache-quota", | 127 | "test-datacache-quota", |
@@ -143,14 +143,22 @@ main (int argc, char *argv[]) | |||
143 | "WARNING", | 143 | "WARNING", |
144 | #endif | 144 | #endif |
145 | NULL); | 145 | NULL); |
146 | |||
146 | /* determine name of plugin to use */ | 147 | /* determine name of plugin to use */ |
147 | plugin_name = argv[0]; | 148 | plugin_name = argv[0]; |
148 | while (NULL != (pos = strstr(plugin_name, "_"))) | 149 | while (NULL != (pos = strstr(plugin_name, "_"))) |
149 | plugin_name = pos+1; | 150 | plugin_name = pos+1; |
151 | if (NULL != (pos = strstr(plugin_name, "."))) | ||
152 | pos[0] = 0; | ||
153 | else | ||
154 | pos = (char *) plugin_name; | ||
155 | |||
150 | GNUNET_snprintf (cfg_name, | 156 | GNUNET_snprintf (cfg_name, |
151 | sizeof (cfg_name), | 157 | sizeof (cfg_name), |
152 | "test_datacache_data_%s.conf", | 158 | "test_datacache_data_%s.conf", |
153 | plugin_name); | 159 | plugin_name); |
160 | if (pos != plugin_name) | ||
161 | pos[0] = '.'; | ||
154 | GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, | 162 | GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, |
155 | xargv, "test-datacache-quota", "nohelp", | 163 | xargv, "test-datacache-quota", "nohelp", |
156 | options, &run, NULL); | 164 | options, &run, NULL); |