Moving files, first attempt at gcrypt compatibility, more interface
[tinc] / src / pokey / pokey.c
index a2385a7..7e61c26 100644 (file)
@@ -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;