Skip to content

Commit d990175

Browse files
committed
fix(stat): fix CI failures
1 parent a58d74b commit d990175

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.vscode/cspell.dictionaries/jargon.wordlist.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ multicall
102102
nmerge
103103
noatime
104104
nocache
105+
NOCLDSTOP
105106
nocreat
106107
noctty
107108
noerror
@@ -129,6 +130,7 @@ primality
129130
pselect
130131
pseudoprime
131132
pseudoprimes
133+
pthread
132134
quantiles
133135
readonly
134136
reparse
@@ -144,10 +146,15 @@ setmask
144146
setlocale
145147
shortcode
146148
shortcodes
149+
sigaction
150+
sigaddset
147151
siginfo
148152
sigmask
149153
sigusr
150154
sigprocmask
155+
SIGRTMAX
156+
SIGRTMIN
157+
sigset
151158
strcasecmp
152159
subcommand
153160
subexpression

src/uu/timeout/src/timeout.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,17 @@ fn preserve_signal_info(signal: libc::c_int) -> libc::c_int {
285285
}
286286

287287
#[cfg(unix)]
288-
#[allow(clippy::reversed_empty_ranges)]
289288
fn block_ignored_signals() -> nix::Result<()> {
290-
let mut set = SigSet::empty();
291-
let rt_signals = if cfg!(target_os = "linux") {
289+
#[cfg(target_os = "linux")]
290+
fn rt_signals() -> impl Iterator<Item = i32> {
292291
libc::SIGRTMIN()..=libc::SIGRTMAX()
293-
} else {
294-
0..=(-1)
295-
};
292+
}
293+
#[cfg(not(target_os = "linux"))]
294+
fn rt_signals() -> impl Iterator<Item = i32> {
295+
std::iter::empty()
296+
}
297+
298+
let mut set = SigSet::empty();
296299
for s in Signal::iterator()
297300
.filter_map(|s| {
298301
if matches!(s, Signal::SIGSTOP | Signal::SIGKILL | Signal::SIGTERM) {
@@ -301,12 +304,12 @@ fn block_ignored_signals() -> nix::Result<()> {
301304
Some(s as i32)
302305
}
303306
})
304-
.chain(rt_signals)
307+
.chain(rt_signals())
305308
{
306309
if is_ignored(s)? {
307310
// We use raw libc bindings because [`nix`] does not support RT signals.
308311
// SAFETY: SigSet is repr(transparent) over sigset_t.
309-
unsafe { libc::sigaddset((&mut set as *mut SigSet).cast(), s) };
312+
unsafe { libc::sigaddset((&raw mut set).cast(), s) };
310313
}
311314
}
312315
pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(&set), None)

src/uucore/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ringbuffer = []
164164
safe-traversal = ["libc"]
165165
selinux = ["dep:selinux"]
166166
smack = ["xattr"]
167-
signals = []
167+
signals = ["libc"]
168168
sum = [
169169
"digest",
170170
"hex",

0 commit comments

Comments
 (0)