Skip to content

Commit

Permalink
update libuv from 0.11.18 to 0.11.29
Browse files Browse the repository at this point in the history
This also includes minimal adjustments to our codebase, for example
callbacks only get a handle and not an additional status and uv_fs_read
wants an uv_but_t now instead of char*.
  • Loading branch information
FROGGS committed Sep 5, 2014
1 parent 92a3472 commit fce509b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/libuv
Submodule libuv updated 186 files
2 changes: 1 addition & 1 deletion build/Makefile.in
Expand Up @@ -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@
Expand Down
9 changes: 5 additions & 4 deletions src/io/dirops.c
Expand Up @@ -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));
}

Expand Down
2 changes: 1 addition & 1 deletion src/io/eventloop.c
Expand Up @@ -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))
Expand Down
8 changes: 5 additions & 3 deletions src/io/syncfile.c
Expand Up @@ -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));
Expand Down Expand Up @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/timers.c
Expand Up @@ -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,
Expand Down

0 comments on commit fce509b

Please sign in to comment.