Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / apps / Gateway / Peer / peerd.cpp
blob0388f20b386b060818302e8fe70e7fc5a7de333d
2 //=============================================================================
3 /**
4 * @file peerd.cpp
6 * Driver for the peer daemon (peerd). Note that this is
7 * completely generic code due to the Service Configurator
8 * framework!
10 * @author Douglas C. Schmidt
12 //=============================================================================
14 #include "ace/OS_NS_unistd.h"
15 #include "Peer.h"
17 int
18 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
20 if (ACE_OS::access (ACE_DEFAULT_SVC_CONF, F_OK) != 0)
22 // Use static linking.
23 ACE_Service_Object_Ptr sp = ACE_SVC_INVOKE (Peer_Factory);
25 if (sp->init (argc - 1, argv + 1) == -1)
26 ACE_ERROR_RETURN ((LM_ERROR,
27 ACE_TEXT ("%p\n"),
28 ACE_TEXT ("init")),
29 1);
31 // Run forever, performing the configured services until we are
32 // shut down by a SIGINT/SIGQUIT signal.
34 ACE_Reactor::instance ()->run_reactor_event_loop ();
36 // Destructor of <ACE_Service_Object_Ptr> automagically call
37 // <fini>.
39 else
41 if (ACE_Service_Config::open (argc, argv) == -1)
42 ACE_ERROR_RETURN ((LM_ERROR,
43 ACE_TEXT ("%p\n"),
44 ACE_TEXT ("open")),
45 1);
46 else // Use dynamic linking.
48 // Run forever, performing the configured services until we
49 // are shut down by a signal (e.g., SIGINT or SIGQUIT).
51 ACE_Reactor::instance ()->run_reactor_event_loop ();
53 return 0;