diff options
author | Marc Laukien <marc@zeroc.com> | 2001-09-18 20:54:44 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-09-18 20:54:44 +0000 |
commit | 7ee44fe640ebeda72bea3fe271fa352cff4870c5 (patch) | |
tree | 1a9d1e700b208054e8ecfb66ce3bd1b25e0d50dd /cpp/demo/Freeze/phonebook/Server.cpp | |
parent | make phonebook demo signal-safe (diff) | |
download | ice-7ee44fe640ebeda72bea3fe271fa352cff4870c5.tar.bz2 ice-7ee44fe640ebeda72bea3fe271fa352cff4870c5.tar.xz ice-7ee44fe640ebeda72bea3fe271fa352cff4870c5.zip |
fixes
Diffstat (limited to 'cpp/demo/Freeze/phonebook/Server.cpp')
-rw-r--r-- | cpp/demo/Freeze/phonebook/Server.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cpp/demo/Freeze/phonebook/Server.cpp b/cpp/demo/Freeze/phonebook/Server.cpp index e6a0c920189..eb4b0e464d8 100644 --- a/cpp/demo/Freeze/phonebook/Server.cpp +++ b/cpp/demo/Freeze/phonebook/Server.cpp @@ -20,20 +20,21 @@ interruptHandler(DWORD) { assert(communicator); communicator->shutdown(); + return TRUE; } static void shutdownOnInterrupt() { - BOOL b = SetConsoleHandler(interruptHandler, TRUE); - assert(b); + SetConsoleCtrlHandler(NULL, FALSE); + SetConsoleCtrlHandler(interruptHandler, TRUE); } static void ignoreInterrupt() { - BOOL b = SetConsoleHandler(interruptHandler, FASLSE); - assert(b); + SetConsoleCtrlHandler(NULL, TRUE); + SetConsoleCtrlHandler(interruptHandler, FALSE); } #else @@ -83,8 +84,8 @@ using namespace std; int run(int argc, char* argv[], const DBEnvPtr& dbenv) { - ignoreInterrupt(); cout << "starting up..." << endl; + ignoreInterrupt(); ObjectAdapterPtr adapter = communicator->createObjectAdapter("PhoneBookAdapter"); DBPtr db = dbenv->open("phonebook"); @@ -114,8 +115,8 @@ run(int argc, char* argv[], const DBEnvPtr& dbenv) shutdownOnInterrupt(); communicator->waitForShutdown(); - ignoreInterrupt(); cout << "shutting down..." << endl; + ignoreInterrupt(); db->put("phonebook", phoneBook); |