diff options
author | Bert Belder <bertbelder@gmail.com> | 2010-11-25 07:19:08 +0300 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2010-12-21 01:51:12 +0300 |
commit | 03a74efb16882061c9e5e8bf7cc88d7b56002c36 (patch) | |
tree | eecca8ac723882246b26cf31f0d576b81f6405b0 /src | |
parent | 8b9f7c6eb2452c31613c25d165fcb2c35562805a (diff) |
Don't break the linux build
Diffstat (limited to 'src')
-rw-r--r-- | src/node_file.cc | 4 | ||||
-rw-r--r-- | src/node_net.cc | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index 5ad5f4d3042..71f3258e4e4 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -24,9 +24,9 @@ #define PATH_MAX 4096 #endif -/* HACK to use pread/pwrite from eio if our platform doesn't have it /* +/* HACK to use pread/pwrite from eio because MINGW32 doesn't have it /* /* TODO fixme */ -#if !HAVE_PREADWRITE +#if __MINGW32__ # define pread eio__pread # define pwrite eio__pwrite #endif diff --git a/src/node_net.cc b/src/node_net.cc index 3242fa7a6a6..d4de4041d43 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -257,9 +257,6 @@ static socklen_t addrlen; static inline Handle<Value> ParseAddressArgs(Handle<Value> first, Handle<Value> second, bool is_bind) { -#ifdef __POSIX__ // No unix sockets on windows - static struct sockaddr_un un; -#endif static struct sockaddr_in in; static struct sockaddr_in6 in6; @@ -553,11 +550,14 @@ static Handle<Value> Listen(const Arguments& args) { FD_ARG(args[0]) int backlog = args[1]->IsInt32() ? args[1]->Int32Value() : 128; +#ifdef __POSIX__ + if (0 > listen(fd, backlog)) { +#else // __MINGW32__ if (0 > listen(_get_osfhandle(fd), backlog)) { +#endif return ThrowException(ErrnoException(errno, "listen")); } - return Undefined(); } |