libuv 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/libuv/AUTHORS +4 -0
- data/ext/libuv/ChangeLog +41 -0
- data/ext/libuv/appveyor.yml +1 -1
- data/ext/libuv/configure.ac +1 -1
- data/ext/libuv/docs/src/errors.rst +4 -2
- data/ext/libuv/docs/src/stream.rst +2 -0
- data/ext/libuv/include/uv-version.h +1 -1
- data/ext/libuv/src/unix/fs.c +53 -30
- data/ext/libuv/src/unix/stream.c +20 -0
- data/ext/libuv/src/unix/udp.c +4 -2
- data/ext/libuv/src/uv-common.c +17 -5
- data/ext/libuv/src/win/fs.c +25 -20
- data/ext/libuv/src/win/tcp.c +9 -0
- data/ext/libuv/test/benchmark-fs-stat.c +1 -1
- data/ext/libuv/test/echo-server.c +1 -1
- data/ext/libuv/test/runner-unix.c +3 -7
- data/ext/libuv/test/test-fs-event.c +148 -137
- data/ext/libuv/test/test-fs.c +171 -154
- data/ext/libuv/test/test-list.h +2 -0
- data/ext/libuv/test/test-signal-multiple-loops.c +1 -0
- data/ext/libuv/test/test-spawn.c +18 -17
- data/ext/libuv/test/test-threadpool-cancel.c +4 -2
- data/lib/libuv/mixins/listener.rb +2 -8
- data/lib/libuv/mixins/stream.rb +2 -1
- data/lib/libuv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efca251c5022c8b1930338e419d3b18768aefd24
|
4
|
+
data.tar.gz: a8083cd695fbed0357daf6fb5bfa143d8117b3e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90c1818cc42e10b76edb107f8a1bbb8582c511dafd12a1ed9c4b883e617146af01922eac241b0a3c012d9a449193c9177bbf401dfae88ce901ade0963f196c83
|
7
|
+
data.tar.gz: 8b4bd90f4adeddc3c94fe0eeecfabe27b569bd327c7945d4193f8108cc9720655a5b8d94a9405ff243c789f3c80318a0f88919ac3c322727e0b15d762b96d427
|
data/ext/libuv/AUTHORS
CHANGED
@@ -214,3 +214,7 @@ Roger A. Light <roger@atchoo.org>
|
|
214
214
|
chenttuuvv <chenttuuvv@yahoo.com>
|
215
215
|
Richard Lau <riclau@uk.ibm.com>
|
216
216
|
ronkorving <rkorving@wizcorp.jp>
|
217
|
+
Corbin Simpson <MostAwesomeDude@gmail.com>
|
218
|
+
Zachary Hamm <zsh@imipolexg.org>
|
219
|
+
Karl Skomski <karl@skomski.com>
|
220
|
+
Jeremy Whitlock <jwhitlock@apache.org>
|
data/ext/libuv/ChangeLog
CHANGED
@@ -1,3 +1,44 @@
|
|
1
|
+
2015.08.20, Version 1.7.1 (Stable), 44f4b6bd82d8ae4583ccc4768a83af778ef69f85
|
2
|
+
|
3
|
+
Changes since version 1.7.0:
|
4
|
+
|
5
|
+
* doc: document the procedure for verifying releases (Saúl Ibarra Corretgé)
|
6
|
+
|
7
|
+
* doc: add note about Windows binaries to the README (Saúl Ibarra Corretgé)
|
8
|
+
|
9
|
+
* doc: use long GPG IDs in MAINTAINERS.md (Saúl Ibarra Corretgé)
|
10
|
+
|
11
|
+
* Revert "stream: squelch ECONNRESET error if already closed" (Saúl Ibarra
|
12
|
+
Corretgé)
|
13
|
+
|
14
|
+
* doc: clarify uv_read_stop() is idempotent (Corbin Simpson)
|
15
|
+
|
16
|
+
* unix: OpenBSD's setsockopt needs an unsigned char for multicast (Zachary
|
17
|
+
Hamm)
|
18
|
+
|
19
|
+
* test: Fix two memory leaks (Karl Skomski)
|
20
|
+
|
21
|
+
* unix,win: return EINVAL on nullptr args in uv_fs_{read,write} (Karl Skomski)
|
22
|
+
|
23
|
+
* win: set accepted TCP sockets as non-inheritable (Saúl Ibarra Corretgé)
|
24
|
+
|
25
|
+
* unix: remove superfluous parentheses in fs macros (Ben Noordhuis)
|
26
|
+
|
27
|
+
* unix: don't copy arguments for sync fs requests (Ben Noordhuis)
|
28
|
+
|
29
|
+
* test: plug small memory leak in unix test runner (Ben Noordhuis)
|
30
|
+
|
31
|
+
* unix,windows: allow NULL loop for sync fs requests (Ben Noordhuis)
|
32
|
+
|
33
|
+
* unix,windows: don't assert on unknown error code (Ben Noordhuis)
|
34
|
+
|
35
|
+
* stream: retry write on EPROTOTYPE on OSX (Brian White)
|
36
|
+
|
37
|
+
* common: fix use of snprintf on Windows (Saúl Ibarra Corretgé)
|
38
|
+
|
39
|
+
* tests: refactored fs watch_dir tests for stability (Jeremy Whitlock)
|
40
|
+
|
41
|
+
|
1
42
|
2015.08.06, Version 1.7.0 (Stable), 415a865d6365ba58d02b92b89d46ba5d7744ec8b
|
2
43
|
|
3
44
|
Changes since version 1.6.1:
|
data/ext/libuv/appveyor.yml
CHANGED
data/ext/libuv/configure.ac
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
14
|
|
15
15
|
AC_PREREQ(2.57)
|
16
|
-
AC_INIT([libuv], [1.7.
|
16
|
+
AC_INIT([libuv], [1.7.1], [https://github.com/libuv/libuv/issues])
|
17
17
|
AC_CONFIG_MACRO_DIR([m4])
|
18
18
|
m4_include([m4/libuv-extra-automake-flags.m4])
|
19
19
|
m4_include([m4/as_case.m4])
|
@@ -322,8 +322,10 @@ API
|
|
322
322
|
|
323
323
|
.. c:function:: const char* uv_strerror(int err)
|
324
324
|
|
325
|
-
Returns the error message for the given error code.
|
325
|
+
Returns the error message for the given error code. Leaks a few bytes
|
326
|
+
of memory when you call it with an unknown error code.
|
326
327
|
|
327
328
|
.. c:function:: const char* uv_err_name(int err)
|
328
329
|
|
329
|
-
Returns the error name for the given error code.
|
330
|
+
Returns the error name for the given error code. Leaks a few bytes
|
331
|
+
of memory when you call it with an unknown error code.
|
@@ -142,6 +142,8 @@ API
|
|
142
142
|
Stop reading data from the stream. The :c:type:`uv_read_cb` callback will
|
143
143
|
no longer be called.
|
144
144
|
|
145
|
+
This function is idempotent and may be safely called on a stopped stream.
|
146
|
+
|
145
147
|
.. c:function:: int uv_write(uv_write_t* req, uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb)
|
146
148
|
|
147
149
|
Write data to stream. Buffers are written in order. Example:
|
data/ext/libuv/src/unix/fs.c
CHANGED
@@ -58,52 +58,63 @@
|
|
58
58
|
# include <sys/sendfile.h>
|
59
59
|
#endif
|
60
60
|
|
61
|
-
#define INIT(
|
61
|
+
#define INIT(subtype) \
|
62
62
|
do { \
|
63
|
-
|
64
|
-
(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
63
|
+
req->type = UV_FS; \
|
64
|
+
if (cb != NULL) \
|
65
|
+
uv__req_init(loop, req, UV_FS); \
|
66
|
+
req->fs_type = UV_FS_ ## subtype; \
|
67
|
+
req->result = 0; \
|
68
|
+
req->ptr = NULL; \
|
69
|
+
req->loop = loop; \
|
70
|
+
req->path = NULL; \
|
71
|
+
req->new_path = NULL; \
|
72
|
+
req->cb = cb; \
|
71
73
|
} \
|
72
74
|
while (0)
|
73
75
|
|
74
76
|
#define PATH \
|
75
77
|
do { \
|
76
|
-
(
|
77
|
-
if (
|
78
|
-
|
78
|
+
assert(path != NULL); \
|
79
|
+
if (cb == NULL) { \
|
80
|
+
req->path = path; \
|
81
|
+
} else { \
|
82
|
+
req->path = uv__strdup(path); \
|
83
|
+
if (req->path == NULL) \
|
84
|
+
return -ENOMEM; \
|
85
|
+
} \
|
79
86
|
} \
|
80
87
|
while (0)
|
81
88
|
|
82
89
|
#define PATH2 \
|
83
90
|
do { \
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
91
|
+
if (cb == NULL) { \
|
92
|
+
req->path = path; \
|
93
|
+
req->new_path = new_path; \
|
94
|
+
} else { \
|
95
|
+
size_t path_len; \
|
96
|
+
size_t new_path_len; \
|
97
|
+
path_len = strlen(path) + 1; \
|
98
|
+
new_path_len = strlen(new_path) + 1; \
|
99
|
+
req->path = uv__malloc(path_len + new_path_len); \
|
100
|
+
if (req->path == NULL) \
|
101
|
+
return -ENOMEM; \
|
102
|
+
req->new_path = req->path + path_len; \
|
103
|
+
memcpy((void*) req->path, path, path_len); \
|
104
|
+
memcpy((void*) req->new_path, new_path, new_path_len); \
|
105
|
+
} \
|
94
106
|
} \
|
95
107
|
while (0)
|
96
108
|
|
97
109
|
#define POST \
|
98
110
|
do { \
|
99
|
-
if (
|
100
|
-
uv__work_submit(
|
111
|
+
if (cb != NULL) { \
|
112
|
+
uv__work_submit(loop, &req->work_req, uv__fs_work, uv__fs_done); \
|
101
113
|
return 0; \
|
102
114
|
} \
|
103
115
|
else { \
|
104
|
-
uv__fs_work(&
|
105
|
-
|
106
|
-
return (req)->result; \
|
116
|
+
uv__fs_work(&req->work_req); \
|
117
|
+
return req->result; \
|
107
118
|
} \
|
108
119
|
} \
|
109
120
|
while (0)
|
@@ -886,8 +897,7 @@ static void uv__fs_done(struct uv__work* w, int status) {
|
|
886
897
|
req->result = -ECANCELED;
|
887
898
|
}
|
888
899
|
|
889
|
-
|
890
|
-
req->cb(req);
|
900
|
+
req->cb(req);
|
891
901
|
}
|
892
902
|
|
893
903
|
|
@@ -1071,6 +1081,9 @@ int uv_fs_read(uv_loop_t* loop, uv_fs_t* req,
|
|
1071
1081
|
unsigned int nbufs,
|
1072
1082
|
int64_t off,
|
1073
1083
|
uv_fs_cb cb) {
|
1084
|
+
if (bufs == NULL || nbufs == 0)
|
1085
|
+
return -EINVAL;
|
1086
|
+
|
1074
1087
|
INIT(READ);
|
1075
1088
|
req->file = file;
|
1076
1089
|
|
@@ -1193,6 +1206,9 @@ int uv_fs_write(uv_loop_t* loop,
|
|
1193
1206
|
unsigned int nbufs,
|
1194
1207
|
int64_t off,
|
1195
1208
|
uv_fs_cb cb) {
|
1209
|
+
if (bufs == NULL || nbufs == 0)
|
1210
|
+
return -EINVAL;
|
1211
|
+
|
1196
1212
|
INIT(WRITE);
|
1197
1213
|
req->file = file;
|
1198
1214
|
|
@@ -1212,7 +1228,14 @@ int uv_fs_write(uv_loop_t* loop,
|
|
1212
1228
|
|
1213
1229
|
|
1214
1230
|
void uv_fs_req_cleanup(uv_fs_t* req) {
|
1215
|
-
|
1231
|
+
/* Only necessary for asychronous requests, i.e., requests with a callback.
|
1232
|
+
* Synchronous ones don't copy their arguments and have req->path and
|
1233
|
+
* req->new_path pointing to user-owned memory. UV_FS_MKDTEMP is the
|
1234
|
+
* exception to the rule, it always allocates memory.
|
1235
|
+
*/
|
1236
|
+
if (req->path != NULL && (req->cb != NULL || req->fs_type == UV_FS_MKDTEMP))
|
1237
|
+
uv__free((void*) req->path); /* Memory is shared with req->new_path. */
|
1238
|
+
|
1216
1239
|
req->path = NULL;
|
1217
1240
|
req->new_path = NULL;
|
1218
1241
|
|
data/ext/libuv/src/unix/stream.c
CHANGED
@@ -809,7 +809,17 @@ start:
|
|
809
809
|
do {
|
810
810
|
n = sendmsg(uv__stream_fd(stream), &msg, 0);
|
811
811
|
}
|
812
|
+
#if defined(__APPLE__)
|
813
|
+
/*
|
814
|
+
* Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
|
815
|
+
* EPROTOTYPE can be returned while trying to write to a socket that is
|
816
|
+
* shutting down. If we retry the write, we should get the expected EPIPE
|
817
|
+
* instead.
|
818
|
+
*/
|
819
|
+
while (n == -1 && (errno == EINTR || errno == EPROTOTYPE));
|
820
|
+
#else
|
812
821
|
while (n == -1 && errno == EINTR);
|
822
|
+
#endif
|
813
823
|
} else {
|
814
824
|
do {
|
815
825
|
if (iovcnt == 1) {
|
@@ -818,7 +828,17 @@ start:
|
|
818
828
|
n = writev(uv__stream_fd(stream), iov, iovcnt);
|
819
829
|
}
|
820
830
|
}
|
831
|
+
#if defined(__APPLE__)
|
832
|
+
/*
|
833
|
+
* Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
|
834
|
+
* EPROTOTYPE can be returned while trying to write to a socket that is
|
835
|
+
* shutting down. If we retry the write, we should get the expected EPIPE
|
836
|
+
* instead.
|
837
|
+
*/
|
838
|
+
while (n == -1 && (errno == EINTR || errno == EPROTOTYPE));
|
839
|
+
#else
|
821
840
|
while (n == -1 && errno == EINTR);
|
841
|
+
#endif
|
822
842
|
}
|
823
843
|
|
824
844
|
if (n < 0) {
|
data/ext/libuv/src/unix/udp.c
CHANGED
@@ -668,6 +668,8 @@ static int uv__setsockopt_maybe_char(uv_udp_t* handle,
|
|
668
668
|
int val) {
|
669
669
|
#if defined(__sun) || defined(_AIX)
|
670
670
|
char arg = val;
|
671
|
+
#elif defined(__OpenBSD__)
|
672
|
+
unsigned char arg = val;
|
671
673
|
#else
|
672
674
|
int arg = val;
|
673
675
|
#endif
|
@@ -702,13 +704,13 @@ int uv_udp_set_ttl(uv_udp_t* handle, int ttl) {
|
|
702
704
|
* so hardcode the size of these options on this platform,
|
703
705
|
* and use the general uv__setsockopt_maybe_char call on other platforms.
|
704
706
|
*/
|
705
|
-
#if defined(__sun) || defined(_AIX)
|
707
|
+
#if defined(__sun) || defined(_AIX) || defined(__OpenBSD__)
|
706
708
|
return uv__setsockopt(handle,
|
707
709
|
IP_TTL,
|
708
710
|
IPV6_UNICAST_HOPS,
|
709
711
|
&ttl,
|
710
712
|
sizeof(ttl));
|
711
|
-
#endif /* defined(__sun) || defined(_AIX) */
|
713
|
+
#endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) */
|
712
714
|
|
713
715
|
return uv__setsockopt_maybe_char(handle,
|
714
716
|
IP_TTL,
|
data/ext/libuv/src/uv-common.c
CHANGED
@@ -137,14 +137,27 @@ uv_buf_t uv_buf_init(char* base, unsigned int len) {
|
|
137
137
|
}
|
138
138
|
|
139
139
|
|
140
|
+
static const char* uv__unknown_err_code(int err) {
|
141
|
+
char buf[32];
|
142
|
+
char* copy;
|
143
|
+
|
144
|
+
#ifndef _WIN32
|
145
|
+
snprintf(buf, sizeof(buf), "Unknown system error %d", err);
|
146
|
+
#else
|
147
|
+
_snprintf(buf, sizeof(buf), "Unknown system error %d", err);
|
148
|
+
#endif
|
149
|
+
copy = uv__strdup(buf);
|
150
|
+
|
151
|
+
return copy != NULL ? copy : "Unknown system error";
|
152
|
+
}
|
153
|
+
|
154
|
+
|
140
155
|
#define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name;
|
141
156
|
const char* uv_err_name(int err) {
|
142
157
|
switch (err) {
|
143
158
|
UV_ERRNO_MAP(UV_ERR_NAME_GEN)
|
144
|
-
default:
|
145
|
-
assert(0);
|
146
|
-
return NULL;
|
147
159
|
}
|
160
|
+
return uv__unknown_err_code(err);
|
148
161
|
}
|
149
162
|
#undef UV_ERR_NAME_GEN
|
150
163
|
|
@@ -153,9 +166,8 @@ const char* uv_err_name(int err) {
|
|
153
166
|
const char* uv_strerror(int err) {
|
154
167
|
switch (err) {
|
155
168
|
UV_ERRNO_MAP(UV_STRERROR_GEN)
|
156
|
-
default:
|
157
|
-
return "Unknown system error";
|
158
169
|
}
|
170
|
+
return uv__unknown_err_code(err);
|
159
171
|
}
|
160
172
|
#undef UV_STRERROR_GEN
|
161
173
|
|
data/ext/libuv/src/win/fs.c
CHANGED
@@ -116,8 +116,8 @@ void uv_fs_init() {
|
|
116
116
|
}
|
117
117
|
|
118
118
|
|
119
|
-
INLINE static int fs__capture_path(
|
120
|
-
const char*
|
119
|
+
INLINE static int fs__capture_path(uv_fs_t* req, const char* path,
|
120
|
+
const char* new_path, const int copy_path) {
|
121
121
|
char* buf;
|
122
122
|
char* pos;
|
123
123
|
ssize_t buf_sz = 0, path_len, pathw_len = 0, new_pathw_len = 0;
|
@@ -1762,8 +1762,7 @@ static void uv__fs_done(struct uv__work* w, int status) {
|
|
1762
1762
|
req->result = UV_ECANCELED;
|
1763
1763
|
}
|
1764
1764
|
|
1765
|
-
|
1766
|
-
req->cb(req);
|
1765
|
+
req->cb(req);
|
1767
1766
|
}
|
1768
1767
|
|
1769
1768
|
|
@@ -1792,7 +1791,7 @@ int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
|
|
1792
1791
|
|
1793
1792
|
uv_fs_req_init(loop, req, UV_FS_OPEN, cb);
|
1794
1793
|
|
1795
|
-
err = fs__capture_path(
|
1794
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
1796
1795
|
if (err) {
|
1797
1796
|
return uv_translate_sys_error(err);
|
1798
1797
|
}
|
@@ -1831,6 +1830,9 @@ int uv_fs_read(uv_loop_t* loop,
|
|
1831
1830
|
unsigned int nbufs,
|
1832
1831
|
int64_t offset,
|
1833
1832
|
uv_fs_cb cb) {
|
1833
|
+
if (bufs == NULL || nbufs == 0)
|
1834
|
+
return UV_EINVAL;
|
1835
|
+
|
1834
1836
|
uv_fs_req_init(loop, req, UV_FS_READ, cb);
|
1835
1837
|
|
1836
1838
|
req->file.fd = fd;
|
@@ -1864,6 +1866,9 @@ int uv_fs_write(uv_loop_t* loop,
|
|
1864
1866
|
unsigned int nbufs,
|
1865
1867
|
int64_t offset,
|
1866
1868
|
uv_fs_cb cb) {
|
1869
|
+
if (bufs == NULL || nbufs == 0)
|
1870
|
+
return UV_EINVAL;
|
1871
|
+
|
1867
1872
|
uv_fs_req_init(loop, req, UV_FS_WRITE, cb);
|
1868
1873
|
|
1869
1874
|
req->file.fd = fd;
|
@@ -1896,7 +1901,7 @@ int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
|
1896
1901
|
|
1897
1902
|
uv_fs_req_init(loop, req, UV_FS_UNLINK, cb);
|
1898
1903
|
|
1899
|
-
err = fs__capture_path(
|
1904
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
1900
1905
|
if (err) {
|
1901
1906
|
return uv_translate_sys_error(err);
|
1902
1907
|
}
|
@@ -1917,7 +1922,7 @@ int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode,
|
|
1917
1922
|
|
1918
1923
|
uv_fs_req_init(loop, req, UV_FS_MKDIR, cb);
|
1919
1924
|
|
1920
|
-
err = fs__capture_path(
|
1925
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
1921
1926
|
if (err) {
|
1922
1927
|
return uv_translate_sys_error(err);
|
1923
1928
|
}
|
@@ -1940,7 +1945,7 @@ int uv_fs_mkdtemp(uv_loop_t* loop, uv_fs_t* req, const char* tpl,
|
|
1940
1945
|
|
1941
1946
|
uv_fs_req_init(loop, req, UV_FS_MKDTEMP, cb);
|
1942
1947
|
|
1943
|
-
err = fs__capture_path(
|
1948
|
+
err = fs__capture_path(req, tpl, NULL, TRUE);
|
1944
1949
|
if (err)
|
1945
1950
|
return uv_translate_sys_error(err);
|
1946
1951
|
|
@@ -1959,7 +1964,7 @@ int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
|
|
1959
1964
|
|
1960
1965
|
uv_fs_req_init(loop, req, UV_FS_RMDIR, cb);
|
1961
1966
|
|
1962
|
-
err = fs__capture_path(
|
1967
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
1963
1968
|
if (err) {
|
1964
1969
|
return uv_translate_sys_error(err);
|
1965
1970
|
}
|
@@ -1980,7 +1985,7 @@ int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
|
|
1980
1985
|
|
1981
1986
|
uv_fs_req_init(loop, req, UV_FS_SCANDIR, cb);
|
1982
1987
|
|
1983
|
-
err = fs__capture_path(
|
1988
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
1984
1989
|
if (err) {
|
1985
1990
|
return uv_translate_sys_error(err);
|
1986
1991
|
}
|
@@ -2003,7 +2008,7 @@ int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
|
2003
2008
|
|
2004
2009
|
uv_fs_req_init(loop, req, UV_FS_LINK, cb);
|
2005
2010
|
|
2006
|
-
err = fs__capture_path(
|
2011
|
+
err = fs__capture_path(req, path, new_path, cb != NULL);
|
2007
2012
|
if (err) {
|
2008
2013
|
return uv_translate_sys_error(err);
|
2009
2014
|
}
|
@@ -2024,7 +2029,7 @@ int uv_fs_symlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
|
2024
2029
|
|
2025
2030
|
uv_fs_req_init(loop, req, UV_FS_SYMLINK, cb);
|
2026
2031
|
|
2027
|
-
err = fs__capture_path(
|
2032
|
+
err = fs__capture_path(req, path, new_path, cb != NULL);
|
2028
2033
|
if (err) {
|
2029
2034
|
return uv_translate_sys_error(err);
|
2030
2035
|
}
|
@@ -2047,7 +2052,7 @@ int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
|
2047
2052
|
|
2048
2053
|
uv_fs_req_init(loop, req, UV_FS_READLINK, cb);
|
2049
2054
|
|
2050
|
-
err = fs__capture_path(
|
2055
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2051
2056
|
if (err) {
|
2052
2057
|
return uv_translate_sys_error(err);
|
2053
2058
|
}
|
@@ -2068,7 +2073,7 @@ int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_uid_t uid,
|
|
2068
2073
|
|
2069
2074
|
uv_fs_req_init(loop, req, UV_FS_CHOWN, cb);
|
2070
2075
|
|
2071
|
-
err = fs__capture_path(
|
2076
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2072
2077
|
if (err) {
|
2073
2078
|
return uv_translate_sys_error(err);
|
2074
2079
|
}
|
@@ -2102,7 +2107,7 @@ int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
|
|
2102
2107
|
|
2103
2108
|
uv_fs_req_init(loop, req, UV_FS_STAT, cb);
|
2104
2109
|
|
2105
|
-
err = fs__capture_path(
|
2110
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2106
2111
|
if (err) {
|
2107
2112
|
return uv_translate_sys_error(err);
|
2108
2113
|
}
|
@@ -2122,7 +2127,7 @@ int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
|
|
2122
2127
|
|
2123
2128
|
uv_fs_req_init(loop, req, UV_FS_LSTAT, cb);
|
2124
2129
|
|
2125
|
-
err = fs__capture_path(
|
2130
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2126
2131
|
if (err) {
|
2127
2132
|
return uv_translate_sys_error(err);
|
2128
2133
|
}
|
@@ -2157,7 +2162,7 @@ int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path,
|
|
2157
2162
|
|
2158
2163
|
uv_fs_req_init(loop, req, UV_FS_RENAME, cb);
|
2159
2164
|
|
2160
|
-
err = fs__capture_path(
|
2165
|
+
err = fs__capture_path(req, path, new_path, cb != NULL);
|
2161
2166
|
if (err) {
|
2162
2167
|
return uv_translate_sys_error(err);
|
2163
2168
|
}
|
@@ -2246,7 +2251,7 @@ int uv_fs_access(uv_loop_t* loop,
|
|
2246
2251
|
|
2247
2252
|
uv_fs_req_init(loop, req, UV_FS_ACCESS, cb);
|
2248
2253
|
|
2249
|
-
err = fs__capture_path(
|
2254
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2250
2255
|
if (err)
|
2251
2256
|
return uv_translate_sys_error(err);
|
2252
2257
|
|
@@ -2268,7 +2273,7 @@ int uv_fs_chmod(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode,
|
|
2268
2273
|
|
2269
2274
|
uv_fs_req_init(loop, req, UV_FS_CHMOD, cb);
|
2270
2275
|
|
2271
|
-
err = fs__capture_path(
|
2276
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2272
2277
|
if (err) {
|
2273
2278
|
return uv_translate_sys_error(err);
|
2274
2279
|
}
|
@@ -2308,7 +2313,7 @@ int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime,
|
|
2308
2313
|
|
2309
2314
|
uv_fs_req_init(loop, req, UV_FS_UTIME, cb);
|
2310
2315
|
|
2311
|
-
err = fs__capture_path(
|
2316
|
+
err = fs__capture_path(req, path, NULL, cb != NULL);
|
2312
2317
|
if (err) {
|
2313
2318
|
return uv_translate_sys_error(err);
|
2314
2319
|
}
|
data/ext/libuv/src/win/tcp.c
CHANGED
@@ -419,6 +419,15 @@ static void uv_tcp_queue_accept(uv_tcp_t* handle, uv_tcp_accept_t* req) {
|
|
419
419
|
return;
|
420
420
|
}
|
421
421
|
|
422
|
+
/* Make the socket non-inheritable */
|
423
|
+
if (!SetHandleInformation((HANDLE) accept_socket, HANDLE_FLAG_INHERIT, 0)) {
|
424
|
+
SET_REQ_ERROR(req, GetLastError());
|
425
|
+
uv_insert_pending_req(loop, (uv_req_t*)req);
|
426
|
+
handle->reqs_pending++;
|
427
|
+
closesocket(accept_socket);
|
428
|
+
return;
|
429
|
+
}
|
430
|
+
|
422
431
|
/* Prepare the overlapped structure. */
|
423
432
|
memset(&(req->u.io.overlapped), 0, sizeof(req->u.io.overlapped));
|
424
433
|
if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
|
@@ -267,15 +267,11 @@ int process_wait(process_info_t* vec, int n, int timeout) {
|
|
267
267
|
kill(p->pid, SIGTERM);
|
268
268
|
}
|
269
269
|
retval = -2;
|
270
|
-
|
271
|
-
/* Wait for thread to finish. */
|
272
|
-
r = pthread_join(tid, NULL);
|
273
|
-
if (r) {
|
274
|
-
perror("pthread_join");
|
275
|
-
retval = -1;
|
276
|
-
}
|
277
270
|
}
|
278
271
|
|
272
|
+
if (pthread_join(tid, NULL))
|
273
|
+
abort();
|
274
|
+
|
279
275
|
terminate:
|
280
276
|
close(args.pipe[0]);
|
281
277
|
close(args.pipe[1]);
|