From 33c8d3c50b1645cad8f36c4f9116fa6fb00ff329 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 15 Apr 2015 18:36:32 -0700 Subject: Compile fixes. --- one.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'one.cpp') diff --git a/one.cpp b/one.cpp index 73c4f329..c8e009d1 100644 --- a/one.cpp +++ b/one.cpp @@ -61,6 +61,7 @@ #include "node/Identity.hpp" #include "node/CertificateOfMembership.hpp" #include "node/Utils.hpp" +#include "node/NetworkController.hpp" #include "osdep/OSUtils.hpp" #include "service/OneService.hpp" #ifdef ZT_ENABLE_NETWORK_CONTROLLER @@ -110,7 +111,7 @@ static Identity getIdFromArg(char *arg) return id; } else { // identity is to be read from a file std::string idser; - if (Utils::readFile(arg,idser)) { + if (OSUtils::readFile(arg,idser)) { if (id.fromString(idser)) return id; } @@ -134,13 +135,13 @@ int idtool(int argc,char **argv) id.generate(); std::string idser = id.toString(true); if (argc >= 3) { - if (!Utils::writeFile(argv[2],idser)) { + if (!OSUtils::writeFile(argv[2],idser)) { fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[2]); return 1; } else printf("%s written"ZT_EOL_S,argv[2]); if (argc >= 4) { idser = id.toString(false); - if (!Utils::writeFile(argv[3],idser)) { + if (!OSUtils::writeFile(argv[3],idser)) { fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[3]); return 1; } else printf("%s written"ZT_EOL_S,argv[3]); @@ -193,7 +194,7 @@ int idtool(int argc,char **argv) } std::string inf; - if (!Utils::readFile(argv[3],inf)) { + if (!OSUtils::readFile(argv[3],inf)) { fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]); return 1; } @@ -212,7 +213,7 @@ int idtool(int argc,char **argv) } std::string inf; - if (!Utils::readFile(argv[3],inf)) { + if (!OSUtils::readFile(argv[3],inf)) { fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]); return 1; } @@ -267,15 +268,12 @@ int idtool(int argc,char **argv) #ifdef __UNIX_LIKE__ static void _sighandlerHup(int sig) { - Node *n = node; - if (n) - n->resync(); } static void _sighandlerQuit(int sig) { - Node *n = node; - if (n) - n->terminate(Node::NODE_NORMAL_TERMINATION,"terminated by signal"); + OneService *s = zt1Service; + if (s) + s->terminate(); else exit(0); } #endif -- cgit v1.2.3