Skip to content

Commit efd2543

Browse files
committed
---
yaml --- r: 112439 b: refs/heads/try c: 7d70434 h: refs/heads/master i: 112437: df5a0f8 112435: 2b20e0b 112431: d168fa4 v: v3
1 parent 05108eb commit efd2543

File tree

17 files changed

+105
-86
lines changed

17 files changed

+105
-86
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: a72a6ec897e1b8d7e125be9bb4b60d89c79aa4c0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b5dd3f05fe95168b5569d0f519636149479eb6ac
5-
refs/heads/try: b536d2bb763d478dbf96c035dbd5b68b5ff639b9
5+
refs/heads/try: 7d70434a1e0ba68753b7d1e83f594dea6d23dd51
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/compiletest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ pub fn test_opts(config: &config) -> test::TestOpts {
267267
ratchet_metrics: config.ratchet_metrics.clone(),
268268
ratchet_noise_percent: config.ratchet_noise_percent.clone(),
269269
save_metrics: config.save_metrics.clone(),
270-
test_shard: config.test_shard.clone()
270+
test_shard: config.test_shard.clone(),
271+
nocapture: false,
271272
}
272273
}
273274

branches/try/src/compiletest/runtest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@ fn fatal(err: ~str) -> ! { error(err); fail!(); }
955955
fn fatal_ProcRes(err: ~str, proc_res: &ProcRes) -> ! {
956956
print!("\n\
957957
error: {}\n\
958+
status: {}\n\
958959
command: {}\n\
959960
stdout:\n\
960961
------------------------------------------\n\
@@ -965,7 +966,8 @@ stderr:\n\
965966
{}\n\
966967
------------------------------------------\n\
967968
\n",
968-
err, proc_res.cmdline, proc_res.stdout, proc_res.stderr);
969+
err, proc_res.status, proc_res.cmdline, proc_res.stdout,
970+
proc_res.stderr);
969971
fail!();
970972
}
971973

branches/try/src/librustuv/async.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use std::cast;
12-
use libc::c_int;
1312
use std::rt::rtio::{Callback, RemoteCallback};
1413
use std::unstable::sync::Exclusive;
1514

@@ -54,8 +53,7 @@ impl UvHandle<uvll::uv_async_t> for AsyncWatcher {
5453
}
5554
}
5655

57-
extern fn async_cb(handle: *uvll::uv_async_t, status: c_int) {
58-
assert!(status == 0);
56+
extern fn async_cb(handle: *uvll::uv_async_t) {
5957
let payload: &mut Payload = unsafe {
6058
cast::transmute(uvll::get_data_for_uv_handle(handle))
6159
};

branches/try/src/librustuv/file.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::c_str::CString;
1212
use std::c_str;
1313
use std::cast::transmute;
1414
use std::cast;
15-
use libc::{c_int, c_char, c_void, size_t, ssize_t};
15+
use libc::{c_int, c_char, c_void, ssize_t};
1616
use libc;
1717
use std::rt::task::BlockedTask;
1818
use std::io::{FileStat, IoError};
@@ -86,14 +86,12 @@ impl FsRequest {
8686
} else {
8787
offset + written as i64
8888
};
89+
let uvbuf = uvll::uv_buf_t {
90+
base: buf.slice_from(written as uint).as_ptr(),
91+
len: (buf.len() - written) as uvll::uv_buf_len_t,
92+
};
8993
match execute(|req, cb| unsafe {
90-
uvll::uv_fs_write(loop_.handle,
91-
req,
92-
fd,
93-
buf.as_ptr().offset(written as int) as *c_void,
94-
(buf.len() - written) as size_t,
95-
offset,
96-
cb)
94+
uvll::uv_fs_write(loop_.handle, req, fd, &uvbuf, 1, offset, cb)
9795
}).map(|req| req.get_result()) {
9896
Err(e) => return Err(e),
9997
Ok(n) => { written += n as uint; }
@@ -106,9 +104,11 @@ impl FsRequest {
106104
-> Result<int, UvError>
107105
{
108106
execute(|req, cb| unsafe {
109-
uvll::uv_fs_read(loop_.handle, req,
110-
fd, buf.as_ptr() as *c_void,
111-
buf.len() as size_t, offset, cb)
107+
let uvbuf = uvll::uv_buf_t {
108+
base: buf.as_ptr(),
109+
len: buf.len() as uvll::uv_buf_len_t,
110+
};
111+
uvll::uv_fs_read(loop_.handle, req, fd, &uvbuf, 1, offset, cb)
112112
}).map(|req| {
113113
req.get_result() as int
114114
})

branches/try/src/librustuv/idle.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use std::cast;
12-
use libc::{c_int, c_void};
12+
use libc::c_void;
1313

1414
use uvll;
1515
use super::{Loop, UvHandle};
@@ -46,8 +46,7 @@ impl IdleWatcher {
4646
assert_eq!(uvll::uv_idle_start(handle, onetime_cb), 0)
4747
}
4848

49-
extern fn onetime_cb(handle: *uvll::uv_idle_t, status: c_int) {
50-
assert_eq!(status, 0);
49+
extern fn onetime_cb(handle: *uvll::uv_idle_t) {
5150
unsafe {
5251
let data = uvll::get_data_for_uv_handle(handle);
5352
let f: ~proc() = cast::transmute(data);
@@ -82,8 +81,7 @@ impl UvHandle<uvll::uv_idle_t> for IdleWatcher {
8281
fn uv_handle(&self) -> *uvll::uv_idle_t { self.handle }
8382
}
8483

85-
extern fn idle_cb(handle: *uvll::uv_idle_t, status: c_int) {
86-
assert_eq!(status, 0);
84+
extern fn idle_cb(handle: *uvll::uv_idle_t) {
8785
let idle: &mut IdleWatcher = unsafe { UvHandle::from_uv_handle(&handle) };
8886
idle.callback.call();
8987
}

branches/try/src/librustuv/net.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,9 @@ impl TcpWatcher {
255255
n => Err(UvError(n))
256256
};
257257

258-
extern fn timer_cb(handle: *uvll::uv_timer_t, status: c_int) {
258+
extern fn timer_cb(handle: *uvll::uv_timer_t) {
259259
// Don't close the corresponding tcp request, just wake up the task
260260
// and let RAII take care of the pending watcher.
261-
assert_eq!(status, 0);
262261
let cx: &mut Ctx = unsafe {
263262
&mut *(uvll::get_data_for_uv_handle(handle) as *mut Ctx)
264263
};
@@ -599,8 +598,7 @@ impl rtio::RtioTcpAcceptor for TcpAcceptor {
599598
self.timeout_tx = Some(tx);
600599
self.timeout_rx = Some(rx);
601600

602-
extern fn timer_cb(timer: *uvll::uv_timer_t, status: c_int) {
603-
assert_eq!(status, 0);
601+
extern fn timer_cb(timer: *uvll::uv_timer_t) {
604602
let acceptor: &mut TcpAcceptor = unsafe {
605603
&mut *(uvll::get_data_for_uv_handle(timer) as *mut TcpAcceptor)
606604
};

branches/try/src/librustuv/queue.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#![allow(dead_code)]
2222

2323
use std::cast;
24-
use libc::{c_void, c_int};
24+
use libc::c_void;
2525
use std::rt::task::BlockedTask;
2626
use std::unstable::mutex::NativeMutex;
2727
use std::sync::arc::UnsafeArc;
@@ -55,8 +55,7 @@ pub struct Queue {
5555
queue: UnsafeArc<State>,
5656
}
5757

58-
extern fn async_cb(handle: *uvll::uv_async_t, status: c_int) {
59-
assert_eq!(status, 0);
58+
extern fn async_cb(handle: *uvll::uv_async_t) {
6059
let pool: &mut QueuePool = unsafe {
6160
cast::transmute(uvll::get_data_for_uv_handle(handle))
6261
};

branches/try/src/librustuv/timer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use libc::c_int;
1211
use std::mem;
1312
use std::rt::rtio::RtioTimer;
1413
use std::rt::task::BlockedTask;
@@ -137,9 +136,8 @@ impl RtioTimer for TimerWatcher {
137136
}
138137
}
139138

140-
extern fn timer_cb(handle: *uvll::uv_timer_t, status: c_int) {
139+
extern fn timer_cb(handle: *uvll::uv_timer_t) {
141140
let _f = ForbidSwitch::new("timer callback can't switch");
142-
assert_eq!(status, 0);
143141
let timer: &mut TimerWatcher = unsafe { UvHandle::from_uv_handle(&handle) };
144142

145143
match timer.action.take_unwrap() {

branches/try/src/librustuv/tty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl TtyWatcher {
4040
// - https://github.com/joyent/libuv/issues/982
4141
// - https://github.com/joyent/libuv/issues/988
4242
let guess = unsafe { uvll::guess_handle(fd) };
43-
if readable && guess != uvll::UV_TTY as libc::c_int {
43+
if guess != uvll::UV_TTY as libc::c_int {
4444
return Err(UvError(uvll::EBADF));
4545
}
4646

branches/try/src/librustuv/uvio.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use libc::{O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY, O_WRONLY, S_IRUSR,
2323
use libc;
2424
use std::path::Path;
2525
use std::rt::rtio;
26-
use std::rt::rtio::IoFactory;
26+
use std::rt::rtio::{IoFactory, EventLoop};
2727
use ai = std::io::net::addrinfo;
2828

2929
#[cfg(test)] use std::unstable::run_in_bare_thread;
@@ -69,14 +69,20 @@ impl Drop for UvEventLoop {
6969
// the loop is free'd (use-after-free). We also must free the uv handle
7070
// after the loop has been closed because during the closing of the loop
7171
// the handle is required to be used apparently.
72+
//
73+
// Lastly, after we've closed the pool of handles we pump the event loop
74+
// one last time to run any closing callbacks to make sure the loop
75+
// shuts down cleanly.
7276
let handle = self.uvio.handle_pool.get_ref().handle();
7377
drop(self.uvio.handle_pool.take());
78+
self.run();
79+
7480
self.uvio.loop_.close();
7581
unsafe { uvll::free_handle(handle) }
7682
}
7783
}
7884

79-
impl rtio::EventLoop for UvEventLoop {
85+
impl EventLoop for UvEventLoop {
8086
fn run(&mut self) {
8187
self.uvio.loop_.run();
8288
}
@@ -110,7 +116,6 @@ impl rtio::EventLoop for UvEventLoop {
110116

111117
#[test]
112118
fn test_callback_run_once() {
113-
use std::rt::rtio::EventLoop;
114119
run_in_bare_thread(proc() {
115120
let mut event_loop = UvEventLoop::new();
116121
let mut count = 0;

branches/try/src/librustuv/uvll.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ impl uv_stat_t {
212212
}
213213
}
214214

215-
pub type uv_idle_cb = extern "C" fn(handle: *uv_idle_t,
216-
status: c_int);
215+
pub type uv_idle_cb = extern "C" fn(handle: *uv_idle_t);
217216
pub type uv_alloc_cb = extern "C" fn(stream: *uv_stream_t,
218217
suggested_size: size_t,
219218
buf: *mut uv_buf_t);
@@ -230,14 +229,12 @@ pub type uv_udp_recv_cb = extern "C" fn(handle: *uv_udp_t,
230229
pub type uv_close_cb = extern "C" fn(handle: *uv_handle_t);
231230
pub type uv_walk_cb = extern "C" fn(handle: *uv_handle_t,
232231
arg: *c_void);
233-
pub type uv_async_cb = extern "C" fn(handle: *uv_async_t,
234-
status: c_int);
232+
pub type uv_async_cb = extern "C" fn(handle: *uv_async_t);
235233
pub type uv_connect_cb = extern "C" fn(handle: *uv_connect_t,
236234
status: c_int);
237235
pub type uv_connection_cb = extern "C" fn(handle: *uv_connection_t,
238236
status: c_int);
239-
pub type uv_timer_cb = extern "C" fn(handle: *uv_timer_t,
240-
status: c_int);
237+
pub type uv_timer_cb = extern "C" fn(handle: *uv_timer_t);
241238
pub type uv_write_cb = extern "C" fn(handle: *uv_write_t,
242239
status: c_int);
243240
pub type uv_getaddrinfo_cb = extern "C" fn(req: *uv_getaddrinfo_t,
@@ -597,10 +594,12 @@ extern {
597594
flags: c_int, mode: c_int, cb: uv_fs_cb) -> c_int;
598595
pub fn uv_fs_unlink(loop_ptr: *uv_loop_t, req: *uv_fs_t, path: *c_char,
599596
cb: uv_fs_cb) -> c_int;
600-
pub fn uv_fs_write(l: *uv_loop_t, req: *uv_fs_t, fd: c_int, buf: *c_void,
601-
len: size_t, offset: i64, cb: uv_fs_cb) -> c_int;
602-
pub fn uv_fs_read(l: *uv_loop_t, req: *uv_fs_t, fd: c_int, buf: *c_void,
603-
len: size_t, offset: i64, cb: uv_fs_cb) -> c_int;
597+
pub fn uv_fs_write(l: *uv_loop_t, req: *uv_fs_t, fd: c_int,
598+
bufs: *uv_buf_t, nbufs: c_uint,
599+
offset: i64, cb: uv_fs_cb) -> c_int;
600+
pub fn uv_fs_read(l: *uv_loop_t, req: *uv_fs_t, fd: c_int,
601+
bufs: *uv_buf_t, nbufs: c_uint,
602+
offset: i64, cb: uv_fs_cb) -> c_int;
604603
pub fn uv_fs_close(l: *uv_loop_t, req: *uv_fs_t, fd: c_int,
605604
cb: uv_fs_cb) -> c_int;
606605
pub fn uv_fs_stat(l: *uv_loop_t, req: *uv_fs_t, path: *c_char,

branches/try/src/libstd/hash/sip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ mod tests {
364364
use option::{Some, None};
365365
use str::{Str,StrSlice};
366366
use strbuf::StrBuf;
367-
use slice::{Vector, ImmutableVector, OwnedVector};
367+
use slice::{Vector, ImmutableVector};
368368
use self::test::Bencher;
369369

370370
use super::super::Hash;

branches/try/src/libstd/rt/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ mod imp {
6767
use clone::Clone;
6868
use option::{Option, Some, None};
6969
use iter::Iterator;
70-
use str::StrSlice;
7170
use unstable::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT};
7271
use mem;
72+
#[cfg(not(test))] use str::StrSlice;
7373
#[cfg(not(test))] use ptr::RawPtr;
7474

7575
static mut global_args_ptr: uint = 0;

0 commit comments

Comments
 (0)