diff options
| author | bors <bors@rust-lang.org> | 2015-02-17 03:42:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-17 03:42:54 +0000 |
| commit | 22224ca4499247e99e18fba8a18a4259f0e4d08b (patch) | |
| tree | a2a083c91ddb8586682039fc48d384c6fa963b38 /src/libstd/os.rs | |
| parent | 81bce5290ff55b9a2eddd83d31b0778180904d7f (diff) | |
| parent | 64d33b1e986116f7bec03b8f2c91fa925b957fa3 (diff) | |
| download | rust-22224ca4499247e99e18fba8a18a4259f0e4d08b.tar.gz rust-22224ca4499247e99e18fba8a18a4259f0e4d08b.zip | |
Auto merge of #21932 - Jormundir:std-os-errno-type, r=alexcrichton
Changes std::os::errno to return i32, the return type used by the function being delegated to. This is my first contribution, so feel free to give me advice. I'll be happy to correct things.
Diffstat (limited to 'src/libstd/os.rs')
| -rw-r--r-- | src/libstd/os.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 2a0206d9ff0..3851e799713 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -514,8 +514,8 @@ pub fn change_dir(p: &Path) -> IoResult<()> { } /// Returns the platform-specific value of errno -pub fn errno() -> uint { - sys::os::errno() as uint +pub fn errno() -> i32 { + sys::os::errno() as i32 } /// Return the string corresponding to an `errno()` value of `errnum`. @@ -525,15 +525,15 @@ pub fn errno() -> uint { /// use std::os; /// /// // Same as println!("{}", last_os_error()); -/// println!("{}", os::error_string(os::errno() as uint)); +/// println!("{}", os::error_string(os::errno() as i32)); /// ``` -pub fn error_string(errnum: uint) -> String { - return sys::os::error_string(errnum as i32); +pub fn error_string(errnum: i32) -> String { + return sys::os::error_string(errnum); } /// Get a string representing the platform-dependent last error pub fn last_os_error() -> String { - error_string(errno() as uint) + error_string(errno()) } /// Sets the process exit code @@ -845,13 +845,13 @@ pub enum MapError { ErrAlreadyExists, /// Unrecognized error from `VirtualAlloc`. The inner value is the return /// value of GetLastError. - ErrVirtualAlloc(uint), + ErrVirtualAlloc(i32), /// Unrecognized error from `CreateFileMapping`. The inner value is the /// return value of `GetLastError`. - ErrCreateFileMappingW(uint), + ErrCreateFileMappingW(i32), /// Unrecognized error from `MapViewOfFile`. The inner value is the return /// value of `GetLastError`. - ErrMapViewOfFile(uint) + ErrMapViewOfFile(i32) } #[stable(feature = "rust1", since = "1.0.0")] |
