diff --git a/include/uv.h b/include/uv.h index 18fdb3198..5c993b451 100644 --- a/include/uv.h +++ b/include/uv.h @@ -1632,7 +1632,7 @@ UV_EXTERN int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb); UV_EXTERN int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, - void* buf, size_t length, int64_t offset, uv_fs_cb cb); + const void* buf, size_t length, int64_t offset, uv_fs_cb cb); UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb); diff --git a/src/unix/fs.c b/src/unix/fs.c index 75b234376..142e4a0b3 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -934,13 +934,13 @@ int uv_fs_utime(uv_loop_t* loop, int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, - void* buf, + const void* buf, size_t len, int64_t off, uv_fs_cb cb) { INIT(WRITE); req->file = file; - req->buf = buf; + req->buf = (void*) buf; req->len = len; req->off = off; POST; diff --git a/src/win/fs.c b/src/win/fs.c index 2ea2cb1c6..9d4d7ff84 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -1521,12 +1521,12 @@ int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file fd, void* buf, } -int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file fd, void* buf, +int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file fd, const void* buf, size_t length, int64_t offset, uv_fs_cb cb) { uv_fs_req_init(loop, req, UV_FS_WRITE, cb); req->fd = fd; - req->buf = buf; + req->buf = (void*) buf; req->length = length; req->offset = offset;