diff --git a/oio-unix.c b/oio-unix.c index d062a7d4..40e92040 100644 --- a/oio-unix.c +++ b/oio-unix.c @@ -740,13 +740,14 @@ static size_t oio__buf_count(oio_buf bufs[], int bufcnt) { /* The buffers to be written must remain valid until the callback is called. * This is not required for the oio_buf array. */ -int oio_write(oio_req* req, oio_buf* bufs, int bufcnt) { +int oio_write(oio_req* req, oio_buf bufs[], int bufcnt) { oio_handle* handle = req->handle; assert(handle->fd >= 0); ngx_queue_init(&req->queue); req->type = OIO_WRITE; + /* TODO: Don't malloc for each write... */ req->bufs = malloc(sizeof(oio_buf) * bufcnt); memcpy(req->bufs, bufs, bufcnt * sizeof(oio_buf)); req->bufcnt = bufcnt; diff --git a/oio.h b/oio.h index 7802afa3..a8264573 100644 --- a/oio.h +++ b/oio.h @@ -209,7 +209,7 @@ int oio_accept(oio_handle* server, oio_handle* client, int oio_read_start(oio_handle* handle, oio_read_cb cb); int oio_read_stop(oio_handle* handle); -int oio_write(oio_req* req, oio_buf* bufs, int bufcnt); +int oio_write(oio_req* req, oio_buf bufs[], int bufcnt); /* Timer methods */ int oio_timeout(oio_req* req, int64_t timeout);