aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_mysql.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2015-01-06 01:11:45 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2015-01-06 01:11:45 +0000
commit55182581d5e44ccc8d7495efd60a8f913d5b057d (patch)
tree219343d5a8d8c02bcb31dd10945dc98a491c340c /src/datastore/plugin_datastore_mysql.c
parent56342b51c42bba7f627de23cde834994171fb267 (diff)
downloadgnunet-55182581d5e44ccc8d7495efd60a8f913d5b057d.tar.gz
gnunet-55182581d5e44ccc8d7495efd60a8f913d5b057d.zip
Workaround emscripten bug in returning int64_t
Emscripten can't return a 64-bit integer from dynamically loaded code.
Diffstat (limited to 'src/datastore/plugin_datastore_mysql.c')
-rw-r--r--src/datastore/plugin_datastore_mysql.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index fab10b206..3a234e365 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -246,22 +246,25 @@ do_delete_entry (struct Plugin *plugin, unsigned long long uid)
246 * @param cls our "struct Plugin *" 246 * @param cls our "struct Plugin *"
247 * @return number of bytes used on disk 247 * @return number of bytes used on disk
248 */ 248 */
249static unsigned long long 249static void
250mysql_plugin_estimate_size (void *cls) 250mysql_plugin_estimate_size (void *cls, unsigned long long *estimate)
251{ 251{
252 struct Plugin *plugin = cls; 252 struct Plugin *plugin = cls;
253 MYSQL_BIND cbind[1]; 253 MYSQL_BIND cbind[1];
254 long long total; 254 long long total;
255 255
256 if (NULL == estimate)
257 return;
256 memset (cbind, 0, sizeof (cbind)); 258 memset (cbind, 0, sizeof (cbind));
257 total = 0; 259 total = 0;
258 cbind[0].buffer_type = MYSQL_TYPE_LONGLONG; 260 cbind[0].buffer_type = MYSQL_TYPE_LONGLONG;
259 cbind[0].buffer = &total; 261 cbind[0].buffer = &total;
260 cbind[0].is_unsigned = GNUNET_NO; 262 cbind[0].is_unsigned = GNUNET_NO;
261 if (GNUNET_OK != 263 if (GNUNET_OK ==
262 GNUNET_MYSQL_statement_run_prepared_select (plugin->mc, plugin->get_size, 1, cbind, NULL, NULL, -1)) 264 GNUNET_MYSQL_statement_run_prepared_select (plugin->mc, plugin->get_size, 1, cbind, NULL, NULL, -1))
263 return 0; 265 *estimate = total;
264 return total; 266 else
267 *estimate = 0;
265} 268}
266 269
267 270