summaryrefslogtreecommitdiff
path: root/deps/uv/test/runner-win.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2017-05-30 13:19:11 -0400
committercjihrig <cjihrig@gmail.com>2017-06-07 09:30:01 -0400
commitedd541957f6bb6fa4ccb56bd1f878172f631ce36 (patch)
tree2a72ce78b05fc122c699d547152414f45d2cc16c /deps/uv/test/runner-win.c
parent12e39d6d943348a19da1bf84d4891aa28cd3ffb6 (diff)
downloadandroid-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.tar.gz
android-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.tar.bz2
android-node-v8-edd541957f6bb6fa4ccb56bd1f878172f631ce36.zip
deps: upgrade libuv to 1.12.0
Fixes: https://github.com/nodejs/node/issues/12853 Fixes: https://github.com/nodejs/node/issues/854 PR-URL: https://github.com/nodejs/node/pull/13306 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/uv/test/runner-win.c')
-rw-r--r--deps/uv/test/runner-win.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c
index 1b4a569aef..0f1b56e777 100644
--- a/deps/uv/test/runner-win.c
+++ b/deps/uv/test/runner-win.c
@@ -209,22 +209,30 @@ long int process_output_size(process_info_t *p) {
int process_copy_output(process_info_t* p, FILE* stream) {
- DWORD read;
char buf[1024];
+ int fd, r;
+ FILE* f;
- if (SetFilePointer(p->stdio_out,
- 0,
- 0,
- FILE_BEGIN) == INVALID_SET_FILE_POINTER) {
+ fd = _open_osfhandle((intptr_t)p->stdio_out, _O_RDONLY | _O_TEXT);
+ if (fd == -1)
+ return -1;
+ f = _fdopen(fd, "rt");
+ if (f == NULL) {
+ _close(fd);
return -1;
}
- while (ReadFile(p->stdio_out, &buf, sizeof(buf), &read, NULL) && read > 0)
- print_lines(buf, read, stream);
+ r = fseek(f, 0, SEEK_SET);
+ if (r < 0)
+ return -1;
- if (GetLastError() != ERROR_HANDLE_EOF)
+ while (fgets(buf, sizeof(buf), f) != NULL)
+ print_lines(buf, strlen(buf), stream);
+
+ if (ferror(f))
return -1;
+ fclose(f);
return 0;
}