Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / apps / JAWS / server / main.cpp
blobba09f3ffd139fec83294752a018c6e8a5761632b
1 #include "ace/Service_Config.h"
2 #include "ace/Reactor.h"
3 #include "ace/Filecache.h"
5 #include "HTTP_Server.h"
6 #include "ace/OS_main.h"
7 #include "ace/OS_NS_signal.h"
9 ACE_STATIC_SVC_REQUIRE(HTTP_Server)
11 #ifdef ACE_HAS_SIG_C_FUNC
12 extern "C"
14 #endif /* ACE_HAS_SIG_C_FUNC */
16 // call exit() so that static destructors get called
17 static void
18 handler (int)
20 delete (ACE_Filecache *) ACE_Filecache::instance ();
21 ACE_OS::exit (0);
24 #ifdef ACE_HAS_SIG_C_FUNC
26 #endif /* ACE_HAS_SIG_C_FUNC */
28 // This is the driver entry point into JAWS. It is possible to use
29 // JAWS as an ACE Service, as well.
31 int
32 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
34 ACE_Service_Config daemon;
36 ACE_OS::signal (SIGCHLD, SIG_IGN);
38 // SigAction not needed since the handler will shutdown the server.
39 ACE_OS::signal (SIGINT, (ACE_SignalHandler) handler);
40 ACE_OS::signal (SIGUSR2, (ACE_SignalHandler) handler);
42 if (daemon.open (argc, argv, ACE_DEFAULT_LOGGER_KEY, 0) != 0)
43 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1);
45 // The configured service creates threads, and the
46 // server won't exit until the threads die.
48 // Run forever, performing the configured services until we receive
49 // a SIGINT.
52 return 0;