summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-02-18 12:14:28 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-02-18 12:14:28 -0500
commitde70d4fb95e82ac4702ac3141d1bf34202f32d51 (patch)
treea2544ffbd3730aaa9b43c03d782504da7a3ef198 /src
parentcda3f32b6ce5f2404bd80f878d1e03982aa3d749 (diff)
fix libc constants to be referenced as libc::mode_t
Diffstat (limited to 'src')
-rw-r--r--src/commands/set_mode.rs3
-rw-r--r--src/unix.rs4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/set_mode.rs b/src/commands/set_mode.rs
index 061b5c3..a9c91c7 100644
--- a/src/commands/set_mode.rs
+++ b/src/commands/set_mode.rs
@@ -1,3 +1,4 @@
+extern crate libc;
extern crate ncurses;
use commands::{JoshutoCommand, JoshutoRunnable};
@@ -37,7 +38,7 @@ impl SetMode {
}
ncurses::doupdate();
- const LIBC_PERMISSION_VALS: [(u32, char); 9] = [
+ const LIBC_PERMISSION_VALS: [(libc::mode_t, char); 9] = [
(libc::S_IRUSR, 'r'),
(libc::S_IWUSR, 'w'),
(libc::S_IXUSR, 'x'),
diff --git a/src/unix.rs b/src/unix.rs
index 9e402d8..3150d93 100644
--- a/src/unix.rs
+++ b/src/unix.rs
@@ -27,8 +27,8 @@ pub fn get_unix_filetype(mode : u32) -> &'static str
}
*/
-pub fn is_executable(mode: u32) -> bool {
- const LIBC_PERMISSION_VALS: [u32; 3] = [libc::S_IXUSR, libc::S_IXGRP, libc::S_IXOTH];
+pub fn is_executable(mode: libc::mode_t) -> bool {
+ const LIBC_PERMISSION_VALS: [libc::mode_t; 3] = [libc::S_IXUSR, libc::S_IXGRP, libc::S_IXOTH];
for val in LIBC_PERMISSION_VALS.iter() {
if mode & val != 0 {