Merge branch 'v0.8'

This commit is contained in:
Ben Noordhuis 2012-10-25 04:43:19 +02:00
commit 5cb4197deb
6 changed files with 28 additions and 2 deletions

View File

@ -122,7 +122,7 @@ struct ngx_queue_s {
#define ngx_queue_foreach(q, h) \ #define ngx_queue_foreach(q, h) \
for ((q) = ngx_queue_head(h); \ for ((q) = ngx_queue_head(h); \
(q) != ngx_queue_sentinel(h); \ (q) != ngx_queue_sentinel(h) && !ngx_queue_empty(h); \
(q) = ngx_queue_next(q)) (q) = ngx_queue_next(q))

View File

@ -30,6 +30,7 @@
#include <net/if.h> #include <net/if.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/prctl.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -186,6 +187,10 @@ uv_err_t uv_set_process_title(const char* title) {
if (process_title.len) if (process_title.len)
strncpy(process_title.str, title, process_title.len - 1); strncpy(process_title.str, title, process_title.len - 1);
#if defined(PR_SET_NAME)
prctl(PR_SET_NAME, title);
#endif
return uv_ok_; return uv_ok_;
} }

View File

@ -321,6 +321,9 @@ static void uv__process_child_init(uv_process_options_t options,
dup2(use_fd, i); dup2(use_fd, i);
close(use_fd); close(use_fd);
} }
if (fd <= 2)
uv__nonblock(fd, 0);
} }
if (options.cwd && chdir(options.cwd)) { if (options.cwd && chdir(options.cwd)) {

View File

@ -24,6 +24,7 @@
#include <limits.h> #include <limits.h>
#include <malloc.h> #include <malloc.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include "uv.h" #include "uv.h"
@ -40,10 +41,23 @@ static uv_once_t uv_init_guard_ = UV_ONCE_INIT;
static uv_once_t uv_default_loop_init_guard_ = UV_ONCE_INIT; static uv_once_t uv_default_loop_init_guard_ = UV_ONCE_INIT;
static void uv__crt_invalid_parameter_handler(const wchar_t* expression,
const wchar_t* function, const wchar_t * file, unsigned int line,
uintptr_t reserved) {
/* No-op. */
}
static void uv_init(void) { static void uv_init(void) {
/* Tell Windows that we will handle critical errors. */ /* Tell Windows that we will handle critical errors. */
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |
SEM_NOOPENFILEERRORBOX); SEM_NOOPENFILEERRORBOX);
/* Tell the CRT to not exit the application when an invalid parameter is */
/* passed. The main issue is that invalid FDs will trigger this behavior. */
#ifdef _WRITE_ABORT_MSG
_set_invalid_parameter_handler(uv__crt_invalid_parameter_handler);
#endif
/* Fetch winapi function pointers. This must be done first because other */ /* Fetch winapi function pointers. This must be done first because other */
/* intialization code might need these function pointers to be loaded. */ /* intialization code might need these function pointers to be loaded. */

View File

@ -1137,9 +1137,12 @@ static void fs__utime(uv_fs_t* req) {
if (fs__utime_handle(handle, req->atime, req->mtime) != 0) { if (fs__utime_handle(handle, req->atime, req->mtime) != 0) {
SET_REQ_WIN32_ERROR(req, GetLastError()); SET_REQ_WIN32_ERROR(req, GetLastError());
CloseHandle(handle);
return; return;
} }
CloseHandle(handle);
req->result = 0; req->result = 0;
} }

View File

@ -1186,6 +1186,7 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) {
} else if (arg == 49) { } else if (arg == 49) {
/* Default background color */ /* Default background color */
bg_color = 0; bg_color = 0;
bg_bright = 0;
} else if (arg >= 90 && arg <= 97) { } else if (arg >= 90 && arg <= 97) {
/* Set bold foreground color */ /* Set bold foreground color */