Skip to content

Commit 6d62450

Browse files
committed
---
yaml --- r: 106458 b: refs/heads/try c: 8c157ed h: refs/heads/master v: v3
1 parent a808bce commit 6d62450

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
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: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
5-
refs/heads/try: 40ab198356bbec05b308b2e61ebc6fe9e23ade9d
5+
refs/heads/try: 8c157ed63d95b4b4ff122493228eb0b5acf1e2ae
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libnative/io/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ fn translate_error(errno: i32, detail: bool) -> IoError {
105105
libc::WSAEADDRINUSE => (io::ConnectionRefused, "address in use"),
106106
libc::ERROR_BROKEN_PIPE => (io::EndOfFile, "the pipe has ended"),
107107

108+
// libuv maps this error code to EISDIR. we do too. if it is found
109+
// to be incorrect, we can add in some more machinery to only
110+
// return this message when ERROR_INVALID_FUNCTION after certain
111+
// win32 calls.
112+
libc::ERROR_INVALID_FUNCTION => (io::InvalidInput,
113+
"illegal operation on a directory"),
114+
108115
x => {
109116
debug!("ignoring {}: {}", x, os::last_os_error());
110117
(io::OtherIoError, "unknown error")
@@ -127,6 +134,7 @@ fn translate_error(errno: i32, detail: bool) -> IoError {
127134
libc::EADDRNOTAVAIL => (io::ConnectionRefused, "address not available"),
128135
libc::EADDRINUSE => (io::ConnectionRefused, "address in use"),
129136
libc::ENOENT => (io::FileNotFound, "no such file or directory"),
137+
libc::EISDIR => (io::InvalidInput, "illegal operation on a directory"),
130138

131139
// These two constants can have the same value on some systems, but
132140
// different values on others, so we can't use a match clause

branches/try/src/libstd/libc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,7 @@ pub mod consts {
16231623
pub static O_NOINHERIT: c_int = 128;
16241624

16251625
pub static ERROR_SUCCESS : c_int = 0;
1626+
pub static ERROR_INVALID_FUNCTION: c_int = 1;
16261627
pub static ERROR_FILE_NOT_FOUND: c_int = 2;
16271628
pub static ERROR_ACCESS_DENIED: c_int = 5;
16281629
pub static ERROR_INVALID_HANDLE : c_int = 6;

0 commit comments

Comments
 (0)