summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-09 20:54:00 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-09 20:54:00 -0700
commit068d311ecc7b52f1adaa894864afa54ef49a3e6e (patch)
treee62de1256cbc981f159c8b023ce1b6bbbc3f27cd /osdep
parent38200cc6a55c3b11502a78251c2bdf09960a2a03 (diff)
downloadinfinitytier-068d311ecc7b52f1adaa894864afa54ef49a3e6e.tar.gz
infinitytier-068d311ecc7b52f1adaa894864afa54ef49a3e6e.zip
TRACE compile fixes, other fixes, and it basically works! It says HELLO.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/HttpClient.cpp3
-rw-r--r--osdep/OSUtils.hpp11
2 files changed, 13 insertions, 1 deletions
diff --git a/osdep/HttpClient.cpp b/osdep/HttpClient.cpp
index 251320ab..1cf78204 100644
--- a/osdep/HttpClient.cpp
+++ b/osdep/HttpClient.cpp
@@ -57,6 +57,7 @@
#include "HttpClient.hpp"
#include "Thread.hpp"
#include "OSUtils.hpp"
+#include "../node/Utils.hpp"
namespace ZeroTier {
@@ -281,7 +282,7 @@ public:
return;
}
++scPos;
- unsigned int rcode = OSUtils::strToUInt(headers.front().substr(scPos,3).c_str());
+ unsigned int rcode = Utils::strToUInt(headers.front().substr(scPos,3).c_str());
if ((!rcode)||(rcode > 999)) {
_doH(_arg,-1,_url,"invalid HTTP response (invalid response code)");
delete this;
diff --git a/osdep/OSUtils.hpp b/osdep/OSUtils.hpp
index 2f7499ba..a0cb1067 100644
--- a/osdep/OSUtils.hpp
+++ b/osdep/OSUtils.hpp
@@ -46,7 +46,9 @@
#include <Windows.h>
#else
#include <unistd.h>
+#include <errno.h>
#include <sys/time.h>
+#include <sys/stat.h>
#include <arpa/inet.h>
#endif
@@ -90,6 +92,15 @@ public:
}
static inline bool rm(const std::string &path) throw() { return rm(path.c_str()); }
+ static inline bool mkdir(const char *path)
+ throw()
+ {
+ if (::mkdir(path,0755) != 0)
+ return (errno == EEXIST);
+ return true;
+ }
+ static inline bool mkdir(const std::string &path) throw() { return OSUtils::mkdir(path.c_str()); }
+
/**
* List a directory's contents
*