diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-09-17 16:53:55 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-17 16:53:55 -0700 |
commit | e3d634eb218f48b7152b40d64b07ff2f0a58ca09 (patch) | |
tree | 4a62ba1d804931fa7d687663c606b7edf7f16ae5 /src/handlers.rs | |
parent | 82d0638139adb64ae634d3b304b1c44f7cb358ee (diff) |
Make mode always u32 and switch to has_mode for StatRes fbs (#761)
Diffstat (limited to 'src/handlers.rs')
-rw-r--r-- | src/handlers.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/handlers.rs b/src/handlers.rs index f13ecec9f..9c218827f 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -533,13 +533,13 @@ macro_rules! to_seconds { } #[cfg(any(unix))] -fn get_mode(perm: fs::Permissions) -> i32 { - (perm.mode() as i32) +fn get_mode(perm: fs::Permissions) -> u32 { + perm.mode() } #[cfg(not(any(unix)))] -fn get_mode(_perm: fs::Permissions) -> i32 { - -1 +fn get_mode(_perm: fs::Permissions) -> u32 { + 0 } fn handle_stat(_d: *const DenoC, base: &msg::Base) -> Box<Op> { @@ -568,6 +568,7 @@ fn handle_stat(_d: *const DenoC, base: &msg::Base) -> Box<Op> { accessed: to_seconds!(metadata.accessed()), created: to_seconds!(metadata.created()), mode: get_mode(metadata.permissions()), + has_mode: cfg!(target_family = "unix"), ..Default::default() }, ); |