Browse Source

os: unbreak windows build

Windows doesn't have MAXHOSTNAMELEN. Introduced in afbadde.
v0.10.5-release
Ben Noordhuis 12 years ago
parent
commit
d58ee7e5c7
  1. 6
      src/node_os.cc

6
src/node_os.cc

@ -39,6 +39,11 @@
# include <sys/utsname.h>
#endif
// Add Windows fallback.
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 256
#endif
namespace node {
using namespace v8;
@ -62,6 +67,7 @@ static Handle<Value> GetHostname(const Arguments& args) {
return ThrowException(ErrnoException(WSAGetLastError(), "gethostname"));
#endif // __MINGW32__
}
buf[sizeof(buf) - 1] = '\0';
return scope.Close(String::New(buf));
}

Loading…
Cancel
Save