diff --git a/3rdparty/libuv b/3rdparty/libuv index 666aa2f068..49cb40c479 160000 --- a/3rdparty/libuv +++ b/3rdparty/libuv @@ -1 +1 @@ -Subproject commit 666aa2f0683dc8b80954c01e5799d476e4068350 +Subproject commit 49cb40c47902dd04c7787e6543e9e13368dc1840 diff --git a/build/Makefile.in b/build/Makefile.in index 9e4f4d33a1..4ed56526de 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -344,7 +344,7 @@ UV_UNIX = 3rdparty/libuv/src/fs-poll@obj@ \ 3rdparty/libuv/src/unix/stream@obj@ \ 3rdparty/libuv/src/unix/tcp@obj@ \ 3rdparty/libuv/src/unix/thread@obj@ \ - 3rdparty/libuv/src/unix/threadpool@obj@ \ + 3rdparty/libuv/src/threadpool@obj@ \ 3rdparty/libuv/src/unix/timer@obj@ \ 3rdparty/libuv/src/unix/tty@obj@ \ 3rdparty/libuv/src/unix/udp@obj@ diff --git a/src/io/dirops.c b/src/io/dirops.c index 862f1357f9..902864fd5e 100644 --- a/src/io/dirops.c +++ b/src/io/dirops.c @@ -150,14 +150,15 @@ void MVM_dir_rmdir(MVMThreadContext *tc, MVMString *path) { MVMString * MVM_dir_cwd(MVMThreadContext *tc) { #ifdef _WIN32 char path[MAX_PATH]; - const size_t max_path = MAX_PATH; + size_t max_path = MAX_PATH; + int r; #else char path[PATH_MAX]; - const size_t max_path = PATH_MAX; -#endif + size_t max_path = PATH_MAX; int r; +#endif - if ((r = uv_cwd(path, max_path)) < 0) { + if ((r = uv_cwd(path, (size_t *)&max_path)) < 0) { MVM_exception_throw_adhoc(tc, "chdir failed: %s", uv_strerror(r)); } diff --git a/src/io/eventloop.c b/src/io/eventloop.c index 8244daa538..e0bdc735d3 100644 --- a/src/io/eventloop.c +++ b/src/io/eventloop.c @@ -43,7 +43,7 @@ static MVMint64 cancel_work(MVMThreadContext *tc) { /* Sees if we have an event loop processing thread set up already, and * sets it up if not. */ -static void idle_handler(uv_idle_t *handle, int status) { +static void idle_handler(uv_idle_t *handle) { MVMThreadContext *tc = (MVMThreadContext *)handle->data; GC_SYNC_POINT(tc); if (!setup_work(tc) && !cancel_work(tc)) diff --git a/src/io/syncfile.c b/src/io/syncfile.c index 1719aea24c..7b06b2460b 100644 --- a/src/io/syncfile.c +++ b/src/io/syncfile.c @@ -91,10 +91,11 @@ static void set_separator(MVMThreadContext *tc, MVMOSHandle *h, MVMString *sep) /* Read a bunch of bytes into the current decode stream. */ static MVMint32 read_to_buffer(MVMThreadContext *tc, MVMIOFileData *data, MVMint32 bytes) { - char *buf = MVM_malloc(bytes); + char *buf = MVM_malloc(bytes); + uv_buf_t read_buf = uv_buf_init(buf, bytes); uv_fs_t req; MVMint32 read; - if ((read = uv_fs_read(tc->loop, &req, data->fd, buf, bytes, -1, NULL)) < 0) { + if ((read = uv_fs_read(tc->loop, &req, data->fd, &read_buf, 1, -1, NULL)) < 0) { MVM_free(buf); MVM_exception_throw_adhoc(tc, "Reading from filehandle failed: %s", uv_strerror(req.result)); @@ -211,7 +212,8 @@ static MVMint64 write_str(MVMThreadContext *tc, MVMOSHandle *h, MVMString *str, MVM_free(output); if (newline) { - if (uv_fs_write(tc->loop, &req, data->fd, "\n", 1, -1, NULL) < 0) + uv_buf_t nl = uv_buf_init("\n", 1); + if (uv_fs_write(tc->loop, &req, data->fd, &nl, 1, -1, NULL) < 0) MVM_exception_throw_adhoc(tc, "Failed to write newline to filehandle: %s", uv_strerror(req.result)); bytes_written++; } diff --git a/src/io/timers.c b/src/io/timers.c index 3be7964206..e0ef559ee3 100644 --- a/src/io/timers.c +++ b/src/io/timers.c @@ -10,7 +10,7 @@ typedef struct { } TimerInfo; /* Timer callback; dispatches schedulee to the queue. */ -static void timer_cb(uv_timer_t *handle, int status) { +static void timer_cb(uv_timer_t *handle) { TimerInfo *ti = (TimerInfo *)handle->data; MVMThreadContext *tc = ti->tc; MVMAsyncTask *t = (MVMAsyncTask *)MVM_repr_at_pos_o(tc,