… | |
… | |
206 | act.sa_flags = SA_RESETHAND; |
206 | act.sa_flags = SA_RESETHAND; |
207 | act.sa_handler = sigterm_handler; sigaction (SIGINT , &act, NULL); |
207 | act.sa_handler = sigterm_handler; sigaction (SIGINT , &act, NULL); |
208 | act.sa_handler = sigterm_handler; sigaction (SIGTERM, &act, NULL); |
208 | act.sa_handler = sigterm_handler; sigaction (SIGTERM, &act, NULL); |
209 | } |
209 | } |
210 | |
210 | |
211 | struct Xob {//D |
|
|
212 | void wcbx () |
|
|
213 | { |
|
|
214 | printf ("wcbx %p\n", pthread_self()); |
|
|
215 | } |
|
|
216 | void dcbx () |
|
|
217 | { |
|
|
218 | printf ("dcbx %p\n", pthread_self()); |
|
|
219 | } |
|
|
220 | }; |
|
|
221 | |
|
|
222 | int |
211 | int |
223 | main (int argc, char **argv, char **envp) |
212 | main (int argc, char **argv, char **envp) |
224 | { |
213 | { |
225 | ERR_load_crypto_strings (); // we have the RAM |
214 | ERR_load_crypto_strings (); // we have the RAM |
226 | |
215 | |
… | |
… | |
241 | { |
230 | { |
242 | printf (_("%s version %s (built %s %s, protocol version %d.%d)\n"), get_identity (), |
231 | printf (_("%s version %s (built %s %s, protocol version %d.%d)\n"), get_identity (), |
243 | VERSION, __DATE__, __TIME__, PROTOCOL_MAJOR, PROTOCOL_MINOR); |
232 | VERSION, __DATE__, __TIME__, PROTOCOL_MAJOR, PROTOCOL_MINOR); |
244 | printf (_("Built with kernel interface %s/%s.\n"), IFTYPE, IFSUBTYPE); |
233 | printf (_("Built with kernel interface %s/%s.\n"), IFTYPE, IFSUBTYPE); |
245 | printf (_ |
234 | printf (_ |
246 | ("Copyright (C) 2003-2008 Marc Lehmann <gvpe@schmorp.de> and others.\n" |
235 | ("Copyright (C) 2003-2011 Marc Lehmann <gvpe@schmorp.de> and others.\n" |
247 | "See the AUTHORS file for a complete list.\n\n" |
236 | "See the AUTHORS file for a complete list.\n\n" |
248 | "GVPE comes with ABSOLUTELY NO WARRANTY. This is free software,\n" |
237 | "GVPE comes with ABSOLUTELY NO WARRANTY. This is free software,\n" |
249 | "and you are welcome to redistribute it under certain conditions;\n" |
238 | "and you are welcome to redistribute it under certain conditions;\n" |
250 | "see the file COPYING for details.\n")); |
239 | "see the file COPYING for details.\n")); |
251 | |
240 | |
… | |
… | |
296 | exit (EXIT_SUCCESS); |
285 | exit (EXIT_SUCCESS); |
297 | |
286 | |
298 | setup_signals (); |
287 | setup_signals (); |
299 | |
288 | |
300 | if (!network.setup ()) |
289 | if (!network.setup ()) |
|
|
290 | if (network.drop_privileges ()) |
301 | { |
291 | { |
302 | ev_run (EV_DEFAULT_ 0); |
292 | ev_run (EV_DEFAULT_ 0); |
303 | cleanup_and_exit (EXIT_FAILURE); |
293 | cleanup_and_exit (EXIT_FAILURE); |
304 | } |
294 | } |
305 | |
295 | |
306 | slog (L_ERR, _("unrecoverable error while setting up network, exiting.")); |
296 | slog (L_CRIT, _("unrecoverable error while setting up network, exiting.")); |
307 | cleanup_and_exit (EXIT_FAILURE); |
297 | cleanup_and_exit (EXIT_FAILURE); |
308 | } |
298 | } |
309 | |
299 | |