From 1f0512c4f6768d30621f0d24c80ac16e476ce0a5 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 19 Sep 2025 13:40:41 -0400 Subject: [PATCH] handle ThrowFatal for Haiku --- daemon/Daemon.h | 1 + daemon/HaikuDaemon.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/daemon/Daemon.h b/daemon/Daemon.h index 6f428ce4..4634414b 100644 --- a/daemon/Daemon.h +++ b/daemon/Daemon.h @@ -134,6 +134,7 @@ namespace util return instance; } + bool init(int argc, char* argv[]); void run (); }; #define Daemon i2p::util::DaemonHaiku::Instance() diff --git a/daemon/HaikuDaemon.cpp b/daemon/HaikuDaemon.cpp index 9512942f..aed095a5 100644 --- a/daemon/HaikuDaemon.cpp +++ b/daemon/HaikuDaemon.cpp @@ -9,12 +9,16 @@ #if defined(__HAIKU__) #include +#include #include #include #include #include #include +#include +#include "version.h" +#include "Log.h" #include "RouterContext.h" #include "Tunnel.h" #include "Daemon.h" @@ -44,7 +48,7 @@ class I2PApp: public BApplication }; MainWindow::MainWindow (): - BWindow (BRect(100, 100, 500, 400), "i2pd", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE), + BWindow (BRect(100, 100, 500, 400), "i2pd " VERSION, B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE), m_Messenger (nullptr, this) { auto r = Bounds (); r.bottom = 20; @@ -94,6 +98,15 @@ namespace i2p { namespace util { + bool DaemonHaiku::init(int argc, char* argv[]) + { + i2p::log::SetThrowFunction ([](const std::string& s) + { + // BAlert ("Critical", s.c_str (), "Ok").Go (); + }); + return Daemon_Singleton::init (argc, argv); + } + void DaemonHaiku::run () { if (isDaemon)