diff options
| author | bors <bors@rust-lang.org> | 2014-11-27 04:32:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-27 04:32:12 +0000 |
| commit | f358ca45c8cf8a5ea8922b5c66403d6a4f4d52ad (patch) | |
| tree | 755e6d6f67ea238da49c5a697375b20b2513bc66 /src/libstd/sys | |
| parent | fac5a07679cac21a580badc84b755b8df0f975cf (diff) | |
| parent | 5816d7f5305ce4401326568785d624e689064311 (diff) | |
| download | rust-f358ca45c8cf8a5ea8922b5c66403d6a4f4d52ad.tar.gz rust-f358ca45c8cf8a5ea8922b5c66403d6a4f4d52ad.zip | |
auto merge of #19342 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 12 | ||||
| -rw-r--r-- | src/libstd/sys/windows/fs.rs | 12 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 30 |
3 files changed, 25 insertions, 29 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 816876b5e4a..4b47b768d60 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -305,12 +305,12 @@ fn mkstat(stat: &libc::stat) -> FileStat { FileStat { size: stat.st_size as u64, kind: match (stat.st_mode as libc::mode_t) & libc::S_IFMT { - libc::S_IFREG => io::TypeFile, - libc::S_IFDIR => io::TypeDirectory, - libc::S_IFIFO => io::TypeNamedPipe, - libc::S_IFBLK => io::TypeBlockSpecial, - libc::S_IFLNK => io::TypeSymlink, - _ => io::TypeUnknown, + libc::S_IFREG => io::FileType::RegularFile, + libc::S_IFDIR => io::FileType::Directory, + libc::S_IFIFO => io::FileType::NamedPipe, + libc::S_IFBLK => io::FileType::BlockSpecial, + libc::S_IFLNK => io::FileType::Symlink, + _ => io::FileType::Unknown, }, perm: FilePermission::from_bits_truncate(stat.st_mode as u32), created: mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64), diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index b881eb2d495..9c4ffb926b5 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -407,12 +407,12 @@ fn mkstat(stat: &libc::stat) -> FileStat { FileStat { size: stat.st_size as u64, kind: match (stat.st_mode as libc::c_int) & libc::S_IFMT { - libc::S_IFREG => io::TypeFile, - libc::S_IFDIR => io::TypeDirectory, - libc::S_IFIFO => io::TypeNamedPipe, - libc::S_IFBLK => io::TypeBlockSpecial, - libc::S_IFLNK => io::TypeSymlink, - _ => io::TypeUnknown, + libc::S_IFREG => io::FileType::RegularFile, + libc::S_IFDIR => io::FileType::Directory, + libc::S_IFIFO => io::FileType::NamedPipe, + libc::S_IFBLK => io::FileType::BlockSpecial, + libc::S_IFLNK => io::FileType::Symlink, + _ => io::FileType::Unknown, }, perm: FilePermission::from_bits_truncate(stat.st_mode as u32), created: stat.st_ctime as u64, diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 7d0151a7b6b..78a8e09dac1 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -33,13 +33,11 @@ use string::String; pub use sys_common::ProcessConfig; -/** - * A value representing a child process. - * - * The lifetime of this value is linked to the lifetime of the actual - * process - the Process destructor calls self.finish() which waits - * for the process to terminate. - */ +/// A value representing a child process. +/// +/// The lifetime of this value is linked to the lifetime of the actual +/// process - the Process destructor calls self.finish() which waits +/// for the process to terminate. pub struct Process { /// The unique id of the process (this should never be negative). pid: pid_t, @@ -263,16 +261,14 @@ impl Process { } } - /** - * Waits for a process to exit and returns the exit code, failing - * if there is no process with the specified id. - * - * Note that this is private to avoid race conditions on unix where if - * a user calls waitpid(some_process.get_id()) then some_process.finish() - * and some_process.destroy() and some_process.finalize() will then either - * operate on a none-existent process or, even worse, on a newer process - * with the same id. - */ + /// Waits for a process to exit and returns the exit code, failing + /// if there is no process with the specified id. + /// + /// Note that this is private to avoid race conditions on unix where if + /// a user calls waitpid(some_process.get_id()) then some_process.finish() + /// and some_process.destroy() and some_process.finalize() will then either + /// operate on a none-existent process or, even worse, on a newer process + /// with the same id. pub fn wait(&self, deadline: u64) -> IoResult<ProcessExit> { use libc::types::os::arch::extra::DWORD; use libc::consts::os::extra::{ |
