mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
os: unbreak windows build
Windows doesn't have MAXHOSTNAMELEN. Introduced in afbadde.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user