Skip to content

Commit ccc6f82

Browse files
committed
---
yaml --- r: 78690 b: refs/heads/try c: 13eb259 h: refs/heads/master v: v3
1 parent a7ac554 commit ccc6f82

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 25ed29a0edb3d48fef843a0b818ee68faf2252da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: ece709f172d180471d59a17bb92aa0c3f3ca25d7
5+
refs/heads/try: 13eb259a091c373393d996596178f145579c9d7e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libstd/rt/uv/file.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl FileDescriptor {
147147
}
148148

149149
// as per bnoordhuis in #libuv: offset >= 0 uses prwrite instead of write
150-
fn write_common(&self, loop_: Loop, buf: Buf, offset: i64, cb: Option<FsCallback>)
150+
fn write_common(&mut self, loop_: Loop, buf: Buf, offset: i64, cb: Option<FsCallback>)
151151
-> int {
152152
let complete_cb_ptr = match cb {
153153
Some(_) => compl_cb,
@@ -166,16 +166,16 @@ impl FileDescriptor {
166166
if is_sync { req.cleanup_and_delete(); }
167167
result
168168
}
169-
pub fn write(&self, loop_: Loop, buf: Buf, offset: i64, cb: FsCallback)
169+
pub fn write(&mut self, loop_: Loop, buf: Buf, offset: i64, cb: FsCallback)
170170
-> int {
171171
self.write_common(loop_, buf, offset, Some(cb))
172172
}
173-
pub fn write_sync(&self, loop_: Loop, buf: Buf, offset: i64)
173+
pub fn write_sync(&mut self, loop_: Loop, buf: Buf, offset: i64)
174174
-> int {
175175
self.write_common(loop_, buf, offset, None)
176176
}
177177

178-
fn read_common(&self, loop_: Loop, buf: Buf,
178+
fn read_common(&mut self, loop_: Loop, buf: Buf,
179179
offset: i64, cb: Option<FsCallback>)
180180
-> int {
181181
let complete_cb_ptr = match cb {
@@ -194,11 +194,11 @@ impl FileDescriptor {
194194
if is_sync { req.cleanup_and_delete(); }
195195
result
196196
}
197-
pub fn read(&self, loop_: Loop, buf: Buf, offset: i64, cb: FsCallback)
197+
pub fn read(&mut self, loop_: Loop, buf: Buf, offset: i64, cb: FsCallback)
198198
-> int {
199199
self.read_common(loop_, buf, offset, Some(cb))
200200
}
201-
pub fn read_sync(&self, loop_: Loop, buf: Buf, offset: i64)
201+
pub fn read_sync(&mut self, loop_: Loop, buf: Buf, offset: i64)
202202
-> int {
203203
self.read_common(loop_, buf, offset, None)
204204
}
@@ -294,7 +294,7 @@ mod test {
294294
|req, uverr| {
295295
let loop_ = req.get_loop();
296296
assert!(uverr.is_none());
297-
let fd = FileDescriptor::from_open_req(req);
297+
let mut fd = FileDescriptor::from_open_req(req);
298298
let raw_fd = fd.native_handle();
299299
let buf = unsafe { *write_buf_ptr };
300300
do fd.write(loop_, buf, -1) |_, uverr| {
@@ -306,7 +306,7 @@ mod test {
306306
|req, uverr| {
307307
assert!(uverr.is_none());
308308
let loop_ = req.get_loop();
309-
let fd = FileDescriptor::from_open_req(req);
309+
let mut fd = FileDescriptor::from_open_req(req);
310310
let raw_fd = fd.native_handle();
311311
let read_buf = unsafe { *read_buf_ptr };
312312
do fd.read(loop_, read_buf, 0) |req, uverr| {
@@ -360,7 +360,7 @@ mod test {
360360
create_flags as int, mode as int);
361361
assert!(status_to_maybe_uv_error_with_loop(
362362
loop_.native_handle(), result as i32).is_none());
363-
let fd = FileDescriptor(result as i32);
363+
let mut fd = FileDescriptor(result as i32);
364364
// write
365365
let result = fd.write_sync(loop_, write_buf, -1);
366366
assert!(status_to_maybe_uv_error_with_loop(
@@ -375,7 +375,7 @@ mod test {
375375
assert!(status_to_maybe_uv_error_with_loop(
376376
loop_.native_handle(), result as i32).is_none());
377377
let len = 1028;
378-
let fd = FileDescriptor(result as i32);
378+
let mut fd = FileDescriptor(result as i32);
379379
// read
380380
let read_mem: ~[u8] = vec::from_elem(len, 0u8);
381381
let buf = slice_to_uv_buf(read_mem);
@@ -413,7 +413,7 @@ mod test {
413413
}
414414
415415
fn naive_print(loop_: Loop, input: &str) {
416-
let stdout = FileDescriptor(STDOUT_FILENO);
416+
let mut stdout = FileDescriptor(STDOUT_FILENO);
417417
let write_val = input.as_bytes();
418418
let write_buf = slice_to_uv_buf(write_val);
419419
stdout.write_sync(loop_, write_buf, -1);

0 commit comments

Comments
 (0)