summaryrefslogtreecommitdiff
path: root/src/Handle.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-18 23:41:54 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-18 23:41:54 -0800
commitaec952125146ef754b755f75bf9281d16e837155 (patch)
treef9632a7fc772044142a589ac6bd41584be830bb2 /src/Handle.cc
parentb2f3f5217a0e9833479367bc3ebbb7926819b71b (diff)
Visual Studio port.
Diffstat (limited to 'src/Handle.cc')
-rw-r--r--src/Handle.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Handle.cc b/src/Handle.cc
index 1a5255d..3b40c84 100644
--- a/src/Handle.cc
+++ b/src/Handle.cc
@@ -8,6 +8,11 @@
#include "Printer.h"
#include "Async.h"
+#ifdef _MSC_VER
+#include <direct.h>
+typedef int mode_t;
+#endif
+
#ifdef _WIN32
static const char * strerror_r(int errorno, char * buf, size_t bufsize) {
#ifdef _MSVC
@@ -237,7 +242,11 @@ class AsyncOpMkdir : public Balau::AsyncOperation {
public:
AsyncOpMkdir(const char * path, mode_t mode, cbResults_t * results) : m_path(path), m_mode(mode), m_results(results) { }
virtual void run() {
+#ifdef _MSC_VER
+ int r = m_results->result = mkdir(m_path);
+#else
int r = m_results->result = mkdir(m_path, m_mode);
+#endif
m_results->errorno = r < 0 ? errno : 0;
}
virtual void done() {