File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,8 @@ pub enum IoErrorKind {
348
348
ConnectionFailed ,
349
349
Closed ,
350
350
ConnectionRefused ,
351
- ConnectionReset
351
+ ConnectionReset ,
352
+ BrokenPipe
352
353
}
353
354
354
355
// XXX: Can't put doc comments on macros
Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ mod test {
233
233
loop {
234
234
let mut stop = false ;
235
235
do io_error:: cond. trap ( |e| {
236
- assert ! ( e. kind == ConnectionReset ) ;
236
+ // NB: ECONNRESET on linux, EPIPE on mac
237
+ assert ! ( e. kind == ConnectionReset || e. kind == BrokenPipe ) ;
237
238
stop = true ;
238
239
} ) . in {
239
240
stream. write ( buf) ;
Original file line number Diff line number Diff line change @@ -272,7 +272,9 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
272
272
EACCES => PermissionDenied,
273
273
ECONNREFUSED => ConnectionRefused,
274
274
ECONNRESET => ConnectionReset,
275
- _ => {
275
+ EPIPE => BrokenPipe,
276
+ e => {
277
+ rtdebug!(" e %u", e as uint);
276
278
// XXX: Need to map remaining uv error types
277
279
OtherIoError
278
280
}
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ pub static EADDRINFO: c_int = 2;
40
40
pub static EACCES : c_int = 3 ;
41
41
pub static ECONNREFUSED : c_int = 12 ;
42
42
pub static ECONNRESET : c_int = 13 ;
43
+ pub static EPIPE : c_int = 36 ;
43
44
44
45
pub struct uv_err_t {
45
46
code : c_int ,
You can’t perform that action at this time.
0 commit comments