X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fpokey%2Fpokey.c;h=7e61c26eca29833486829b196b325af88a07ef93;hb=04d33be4bd102de67bb6dba5c449e12fea0db4d2;hp=a2385a7f74a5996d75a4ffb955ea9f0b5619378a;hpb=17b308f0f0879c01f6864265af2e63595e965993;p=tinc diff --git a/src/pokey/pokey.c b/src/pokey/pokey.c index a2385a7f..7e61c26e 100644 --- a/src/pokey/pokey.c +++ b/src/pokey/pokey.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: pokey.c,v 1.1 2002/04/11 14:23:56 zarq Exp $ + $Id: pokey.c,v 1.3 2002/04/28 12:46:26 zarq Exp $ */ #include "config.h" @@ -56,6 +56,7 @@ #include "process.h" #include "protocol.h" #include "subnet.h" +#include "logging.h" #include "system.h" @@ -274,7 +275,8 @@ void make_names(void) if(!confbase) asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname); else - log_message(LOG_INFO, _("Both netname and configuration directory given, using the latter...")); + log(0, LOG_INFO, + _("Both netname and configuration directory given, using the latter...")); if(!identname) asprintf(&identname, "tinc.%s", netname); } @@ -317,22 +319,9 @@ main(int argc, char **argv, char **envp) if(show_help) usage(0); - gnome_init("Pokey", "0.0", 1, fake_argv); - - glade_init(); - - xml = glade_xml_new("pokey.glade", NULL); - - if (!xml) { - g_warning("something bad happened while creating the interface"); - return 1; - } + log_add_hook(log_default); -/* if(geteuid()) */ -/* { */ -/* fprintf(stderr, _("You must be root to run this program.\n")); */ -/* return 1; */ -/* } */ + gnome_init("Pokey", "0.0", 1, fake_argv); g_argv = argv; @@ -357,7 +346,8 @@ cp if(init_interface()) { - fprintf(stderr, _("Could not setup all necessary interface elements.\n")); + log(0, TLOG_ERROR, + _("Could not setup all necessary interface elements.\n")); exit(1); } @@ -366,8 +356,11 @@ cp main_loop(); cleanup_and_exit(1); } - - log_message(LOG_ERR, _("Unrecoverable error")); + + log_add_hook(log_default); + + log(0, TLOG_ERROR, + _("Could not set up network connections")); cp_trace(); return 1;