ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/gvpe.C
(Generate patch)

Comparing gvpe/src/gvpe.C (file contents):
Revision 1.9 by pcg, Tue Jun 21 08:50:37 2005 UTC vs.
Revision 1.10 by pcg, Sat Nov 10 05:14:22 2007 UTC

48 48
49#include "conf.h" 49#include "conf.h"
50#include "slog.h" 50#include "slog.h"
51#include "util.h" 51#include "util.h"
52#include "vpn.h" 52#include "vpn.h"
53#include "iom.h" 53#include "ev_cpp.h"
54 54
55static loglevel llevel = L_NONE; 55static loglevel llevel = L_NONE;
56 56
57/* If nonzero, display usage information and exit. */ 57/* If nonzero, display usage information and exit. */
58static int show_help; 58static int show_help;
161*/ 161*/
162RETSIGTYPE 162RETSIGTYPE
163sigterm_handler (int a) 163sigterm_handler (int a)
164{ 164{
165 network.events |= vpn::EVENT_SHUTDOWN; 165 network.events |= vpn::EVENT_SHUTDOWN;
166 network.event.start (0); 166 network.event.start ();
167} 167}
168 168
169RETSIGTYPE 169RETSIGTYPE
170sighup_handler (int a) 170sighup_handler (int a)
171{ 171{
172 network.events |= vpn::EVENT_RECONNECT; 172 network.events |= vpn::EVENT_RECONNECT;
173 network.event.start (0); 173 network.event.start ();
174} 174}
175 175
176RETSIGTYPE 176RETSIGTYPE
177sigusr1_handler (int a) 177sigusr1_handler (int a)
178{ 178{
252 { 252 {
253 thisnode = *argv++; 253 thisnode = *argv++;
254 argc--; 254 argc--;
255 } 255 }
256 256
257 if (!ev::ev_default_loop (0))
258 {
259 slog (L_ERR, _("unable to initialise the event loop (bad $LIBEV_METHODS?)"));
260 exit (EXIT_FAILURE);
261 }
262
257 { 263 {
258 configuration_parser (conf, true, argc, argv); 264 configuration_parser (conf, true, argc, argv);
259 } 265 }
260 266
261 set_loglevel (llevel != L_NONE ? llevel : conf.llevel); 267 set_loglevel (llevel != L_NONE ? llevel : conf.llevel);
274 280
275 setup_signals (); 281 setup_signals ();
276 282
277 if (!network.setup ()) 283 if (!network.setup ())
278 { 284 {
279 io_manager::loop (); 285 ev::ev_loop (0);
280 cleanup_and_exit (EXIT_FAILURE); 286 cleanup_and_exit (EXIT_FAILURE);
281 } 287 }
282 288
283 slog (L_ERR, _("unable to setup network, unrecoverable error, exiting.")); 289 slog (L_ERR, _("unable to setup network, unrecoverable error, exiting."));
284 cleanup_and_exit (EXIT_FAILURE); 290 cleanup_and_exit (EXIT_FAILURE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines