Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'v0.8'
  • Loading branch information
piscisaureus committed Jun 29, 2012
2 parents 2d0011f + f2a9ed4 commit ba0efd6
Show file tree
Hide file tree
Showing 20 changed files with 411 additions and 296 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -31,7 +31,7 @@ out/Debug/node:
$(MAKE) -C out BUILDTYPE=Debug

out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
tools/gyp_node -f make
$(PYTHON) tools/gyp_node -f make

install: all
out/Release/node tools/installer.js install $(DESTDIR)
Expand Down
18 changes: 9 additions & 9 deletions configure
Expand Up @@ -241,24 +241,24 @@ def target_arch():

def compiler_version():
try:
proc = subprocess.Popen([CC, '-v'], stderr=subprocess.PIPE)
proc = subprocess.Popen(CC.split() + ['-v'], stderr=subprocess.PIPE)
except OSError:
return None
return (False, False, None)
lines = proc.communicate()[1].split('\n')
version_line = None
for i, line in enumerate(lines):
if 'version' in line:
version_line = line
if not version_line:
return None
return (False, False, None)
version = version_line.split("version")[1].strip().split()[0].split(".")
if not version:
return None
return (False, False, None)
return ('LLVM' in version_line, 'clang' in CC, tuple(version))

def configure_node(o):
# TODO add gdb
o['variables']['node_prefix'] = options.prefix if options.prefix else ''
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '')
o['variables']['node_install_npm'] = b(not options.without_npm)
o['variables']['node_install_waf'] = b(not options.without_waf)
o['variables']['host_arch'] = host_arch()
Expand Down Expand Up @@ -327,7 +327,6 @@ def configure_v8(o):
o['libraries'] += ['-lv8']
if options.shared_v8_includes:
o['include_dirs'] += [options.shared_v8_includes]
o['variables']['node_shared_v8_includes'] = options.shared_v8_includes


def configure_openssl(o):
Expand Down Expand Up @@ -398,7 +397,8 @@ write('config.mk', "# Do not edit. Generated by the configure script.\n" +
("BUILDTYPE=%s\n" % ('Debug' if options.debug else 'Release')))

if os.name == 'nt':
subprocess.call(['python', 'tools/gyp_node', '-f', 'msvs',
'-G', 'msvs_version=2010'])
gyp_args = ['-f', 'msvs', '-G', 'msvs_version=2010']
else:
subprocess.call(['tools/gyp_node', '-f', 'make'])
gyp_args = ['-f', 'make']

subprocess.call([sys.executable, 'tools/gyp_node'] + gyp_args)
3 changes: 2 additions & 1 deletion deps/uv/include/uv.h
Expand Up @@ -126,7 +126,8 @@ extern "C" {
XX( 53, ENOTEMPTY, "directory not empty") \
XX( 54, ENOSPC, "no space left on device") \
XX( 55, EIO, "i/o error") \
XX( 56, EROFS, "read-only file system" )
XX( 56, EROFS, "read-only file system" ) \
XX( 57, ENODEV, "no such device" )


#define UV_ERRNO_GEN(val, name, s) UV_##name = val,
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/dl.c
Expand Up @@ -34,7 +34,7 @@ int uv_dlopen(const char* filename, uv_lib_t* lib) {
dlerror(); /* Reset error status. */
lib->errmsg = NULL;
lib->handle = dlopen(filename, RTLD_LAZY);
return uv__dlerror(lib);
return lib->handle ? 0 : uv__dlerror(lib);
}


Expand Down
1 change: 1 addition & 0 deletions deps/uv/src/unix/error.c
Expand Up @@ -86,6 +86,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case EADDRNOTAVAIL: return UV_EADDRNOTAVAIL;
case ENOTDIR: return UV_ENOTDIR;
case EISDIR: return UV_EISDIR;
case ENODEV: return UV_ENODEV;
case ENOTCONN: return UV_ENOTCONN;
case EEXIST: return UV_EEXIST;
case EHOSTUNREACH: return UV_EHOSTUNREACH;
Expand Down
71 changes: 30 additions & 41 deletions deps/uv/src/unix/stream.c
Expand Up @@ -802,62 +802,51 @@ int uv__connect(uv_connect_t* req, uv_stream_t* stream, struct sockaddr* addr,
int sockfd;
int r;

if (stream->type != UV_TCP)
return uv__set_sys_error(stream->loop, ENOTSOCK);

if (stream->connect_req)
return uv__set_sys_error(stream->loop, EALREADY);

if (stream->fd <= 0) {
if ((sockfd = uv__socket(addr->sa_family, SOCK_STREAM, 0)) == -1) {
uv__set_sys_error(stream->loop, errno);
return -1;
}
sockfd = uv__socket(addr->sa_family, SOCK_STREAM, 0);

if (sockfd == -1)
return uv__set_sys_error(stream->loop, errno);

if (uv__stream_open(stream,
sockfd,
UV_STREAM_READABLE | UV_STREAM_WRITABLE)) {
close(sockfd);
return -2;
return -1;
}
}

uv__req_init(stream->loop, req, UV_CONNECT);
req->cb = cb;
req->handle = stream;
ngx_queue_init(&req->queue);

if (stream->connect_req) {
uv__set_sys_error(stream->loop, EALREADY);
return -1;
}

if (stream->type != UV_TCP) {
uv__set_sys_error(stream->loop, ENOTSOCK);
return -1;
}

stream->connect_req = req;
stream->delayed_error = 0;

do {
do
r = connect(stream->fd, addr, addrlen);
}
while (r == -1 && errno == EINTR);

stream->delayed_error = 0;

if (r != 0 && errno != EINPROGRESS) {
switch (errno) {
/* If we get a ECONNREFUSED wait until the next tick to report the
* error. Solaris wants to report immediately--other unixes want to
* wait.
*
* XXX: do the same for ECONNABORTED?
*/
case ECONNREFUSED:
stream->delayed_error = errno;
break;

default:
uv__set_sys_error(stream->loop, errno);
return -1;
}
if (r == -1) {
if (errno == EINPROGRESS)
; /* not an error */
else if (errno == ECONNREFUSED)
/* If we get a ECONNREFUSED wait until the next tick to report the
* error. Solaris wants to report immediately--other unixes want to
* wait.
*/
stream->delayed_error = errno;
else
return uv__set_sys_error(stream->loop, errno);
}

uv__req_init(stream->loop, req, UV_CONNECT);
req->cb = cb;
req->handle = stream;
ngx_queue_init(&req->queue);
stream->connect_req = req;

uv__io_start(stream->loop, &stream->write_watcher);

if (stream->delayed_error)
Expand Down
8 changes: 0 additions & 8 deletions deps/uv/src/unix/sunos.c
Expand Up @@ -332,14 +332,6 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
lookup_instance = 0;
while ((ksp = kstat_lookup(kc, (char *)"cpu_info", lookup_instance, NULL))) {
if (kstat_read(kc, ksp, NULL) == -1) {
/*
* It is deeply annoying, but some kstats can return errors
* under otherwise routine conditions. (ACPI is one
* offender; there are surely others.) To prevent these
* fouled kstats from completely ruining our day, we assign
* an "error" member to the return value that consists of
* the strerror().
*/
cpu_info->speed = 0;
cpu_info->model = NULL;
} else {
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/src/win/error.c
Expand Up @@ -83,9 +83,11 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_SIGNAL_REFUSED: return UV_EIO;
case ERROR_FILE_NOT_FOUND: return UV_ENOENT;
case ERROR_INVALID_NAME: return UV_ENOENT;
case ERROR_INVALID_REPARSE_DATA: return UV_ENOENT;
case ERROR_MOD_NOT_FOUND: return UV_ENOENT;
case ERROR_PATH_NOT_FOUND: return UV_ENOENT;
case ERROR_ACCESS_DENIED: return UV_EPERM;
case ERROR_PRIVILEGE_NOT_HELD: return UV_EPERM;
case ERROR_NOACCESS: return UV_EACCES;
case WSAEACCES: return UV_EACCES;
case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE;
Expand All @@ -110,6 +112,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_OPERATION_ABORTED: return UV_EINTR;
case WSAEINTR: return UV_EINTR;
case ERROR_INVALID_DATA: return UV_EINVAL;
case ERROR_SYMLINK_NOT_SUPPORTED: return UV_EINVAL;
case WSAEINVAL: return UV_EINVAL;
case ERROR_CANT_RESOLVE_FILENAME: return UV_ELOOP;
case ERROR_TOO_MANY_OPEN_FILES: return UV_EMFILE;
Expand Down

0 comments on commit ba0efd6

Please sign in to comment.