commit 002a4f1f3cc275edf48db2dd867c5fbeec2c0cae
parent 962ca22f9bc05b5f07eb895a679e844f2a62bcbe
Author: t3sserakt <t3ss@posteo.de>
Date: Mon, 12 Aug 2024 09:44:44 +0200
Latest try to fix temporary file handling.
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/android_studio/app/src/main/cpp/native-lib.cpp b/android_studio/app/src/main/cpp/native-lib.cpp
@@ -5,7 +5,7 @@
#include <android/asset_manager_jni.h>
#include "gnunet_util_lib.h"
-#define TAG "MY_TAG"
+#define TAG "GNUNET"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__)
@@ -243,11 +243,16 @@ Java_org_gnu_gnunet_MainActivity_stringFromJNI(
android_java_asset_manager = (*env).NewGlobalRef(assets);
AAssetManager *mgr = AAssetManager_fromJava(env, android_java_asset_manager);
+ std::string tmp_file = GNUNET_DISK_mktemp ("test");
+ LOGD ("Temp file is here: %s", tmp_file.c_str());
+
+ char *const non_const_ptr = const_cast<char*>(tmp_file.c_str());
+
char *const argvx[] = {
"-L",
"DEBUG",
"-l",
- "test.out",
+ non_const_ptr,
NULL
};
@@ -256,9 +261,6 @@ Java_org_gnu_gnunet_MainActivity_stringFromJNI(
GNUNET_GETOPT_OPTION_END
};
- std::string tmp_file = GNUNET_DISK_mktemp ("test");
- LOGD ("Temp file is here: %s", tmp_file.c_str());
-
start_logger(tag);
printf("Some message.\n");
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,