Commit 3f26ea5
mkfifo: fix build where mode_t is not u32
`rustix::fs::Mode` is a bitflags over `rustix::fs::RawMode`, which
aliases `libc::mode_t`. That is `u32` on Linux but `u16` on the BSDs,
so handing the `u32` mode straight to `Mode::from_bits_truncate()`
fails to compile there:
error[E0308]: mismatched types
--> src/uu/mkfifo/src/mkfifo.rs:146:50
|
146 | mkfifoat(CWD, path, Mode::from_bits_truncate(mode))
| ------------------------ ^^^^ expected `u16`, found `u32`
Cast to `RawMode` first, which is a no-op on Linux and matches what
`mkdir` already does in src/uu/mkdir/src/mkdir.rs.
Co-authored-by: oech3 <79379754+oech3@users.noreply.github.com>1 parent 667a82b commit 3f26ea5
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
0 commit comments