Skip to content

Commit

Permalink
Catch the exception properly when wvdbusd.dll can't be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
apenwarr committed Oct 8, 2008
1 parent eae9e48 commit aaae010
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions versaplexd/versaplexd.cs
Expand Up @@ -73,6 +73,7 @@ static void _StartDBusServerThread(string[] monikers)
static void StartDBusServerThread(string[] monikers)
{
if (monikers.Length == 0) return;
wv.assert(WvDBusServer.check() == 42, "wvdbusd.dll test failed");
thread_ready.Reset();
dbusserver_thread = new Thread(() => _StartDBusServerThread(monikers));
dbusserver_thread.Start();
Expand Down
8 changes: 8 additions & 0 deletions versaplexd/wvdbusserver.cs
Expand Up @@ -15,6 +15,14 @@ public class WvDBusServer : IDisposable
[DllImport("wvdbusd.dll")]
static extern void wvdbusd_runonce();

[DllImport("wvdbusd.dll")]
static extern int wvdbusd_check();

public static int check()
{
return wvdbusd_check();
}

public WvDBusServer()
{
wvdbusd_start();
Expand Down
5 changes: 5 additions & 0 deletions vxodbc/wvdbusd.cc
Expand Up @@ -42,3 +42,8 @@ extern "C" void wvdbusd_runonce()
// with.
s->runonce(1000);
}

extern "C" int wvdbusd_check()
{
return 42;
}
1 change: 1 addition & 0 deletions vxodbc/wvdbusd.def
Expand Up @@ -4,3 +4,4 @@ wvdbusd_start @1
wvdbusd_stop @2
wvdbusd_listen @3
wvdbusd_runonce @4
wvdbusd_check @5
1 change: 1 addition & 0 deletions vxodbc/wvdbusd.link
Expand Up @@ -4,6 +4,7 @@
wvdbusd_stop;
wvdbusd_listen;
wvdbusd_runonce;
wvdbusd_check;
local:
*;
};

0 comments on commit aaae010

Please sign in to comment.