Skip to content

Commit d7453e4

Browse files
committed
Use libc_bitflags for stat::Mode
1 parent 24320bb commit d7453e4

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

src/sys/stat.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,23 @@ libc_bitflags!(
2020
}
2121
);
2222

23-
bitflags! {
23+
libc_bitflags! {
2424
pub struct Mode: mode_t {
25-
const S_IRWXU = libc::S_IRWXU;
26-
const S_IRUSR = libc::S_IRUSR;
27-
const S_IWUSR = libc::S_IWUSR;
28-
const S_IXUSR = libc::S_IXUSR;
29-
30-
const S_IRWXG = libc::S_IRWXG;
31-
const S_IRGRP = libc::S_IRGRP;
32-
const S_IWGRP = libc::S_IWGRP;
33-
const S_IXGRP = libc::S_IXGRP;
34-
35-
const S_IRWXO = libc::S_IRWXO;
36-
const S_IROTH = libc::S_IROTH;
37-
const S_IWOTH = libc::S_IWOTH;
38-
const S_IXOTH = libc::S_IXOTH;
39-
40-
const S_ISUID = libc::S_ISUID as mode_t;
41-
const S_ISGID = libc::S_ISGID as mode_t;
42-
const S_ISVTX = libc::S_ISVTX as mode_t;
25+
S_IRWXU;
26+
S_IRUSR;
27+
S_IWUSR;
28+
S_IXUSR;
29+
S_IRWXG;
30+
S_IRGRP;
31+
S_IWGRP;
32+
S_IXGRP;
33+
S_IRWXO;
34+
S_IROTH;
35+
S_IWOTH;
36+
S_IXOTH;
37+
S_ISUID as mode_t;
38+
S_ISGID as mode_t;
39+
S_ISVTX as mode_t;
4340
}
4441
}
4542

0 commit comments

Comments
 (0)