Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/uu/nice/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ nice-about = Run COMMAND with an adjusted niceness, which affects process schedu
nice-usage = nice [OPTION] [COMMAND [ARG]...]

# Error messages
nice-error-getpriority = getpriority: { $error }
nice-error-command-required-with-adjustment = A command must be given with an adjustment.
nice-error-invalid-number = "{ $value }" is not a valid number: { $error }
nice-warning-setpriority = { $util_name }: warning: setpriority: { $error }
nice-error-execvp = execvp: { $error }

# Help text for command-line arguments
nice-help-adjustment = add N to the niceness (default is 10)
13 changes: 2 additions & 11 deletions src/uu/nice/src/nice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@
if Error::last_os_error().raw_os_error().unwrap() != 0 {
return Err(USimpleError::new(
125,
get_message_with_args(
"nice-error-getpriority",
HashMap::from([("error".to_string(), Error::last_os_error().to_string())]),
),
format!("getpriority: {}", Error::last_os_error()),

Check warning on line 114 in src/uu/nice/src/nice.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/nice/src/nice.rs#L114

Added line #L114 was not covered by tests
));
}

Expand Down Expand Up @@ -183,13 +180,7 @@
execvp(args[0], args.as_mut_ptr());
}

show_error!(
"{}",
get_message_with_args(
"nice-error-execvp",
HashMap::from([("error".to_string(), Error::last_os_error().to_string())])
)
);
show_error!("execvp: {}", Error::last_os_error());

Check warning on line 183 in src/uu/nice/src/nice.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/nice/src/nice.rs#L183

Added line #L183 was not covered by tests

let exit_code = if Error::last_os_error().raw_os_error().unwrap() as c_int == libc::ENOENT {
127
Expand Down
Loading