Skip to content

Conversation

@jgarzik
Copy link
Contributor

@jgarzik jgarzik commented Nov 30, 2025

No description provided.

@jgarzik jgarzik requested a review from Copilot November 30, 2025 23:59
@jgarzik jgarzik self-assigned this Nov 30, 2025
@jgarzik jgarzik added bug Something isn't working enhancement New feature or request cleanup labels Nov 30, 2025
Copilot finished reviewing on behalf of jgarzik December 1, 2025 00:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive test coverage for the ipcs and ipcrm utilities and includes numerous code review fixes to improve correctness, error handling, and POSIX compliance.

  • Adds 13 tests for ipcs covering various command-line options and facility types
  • Adds 8 tests for ipcrm covering error cases and multiple IPC object removal
  • Refactors ipcs to properly handle Linux and macOS platform differences using /proc/sysvipc on Linux
  • Improves ipcrm to support multiple IPC objects per invocation and better error reporting

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
sys/tests/sys-tests.rs Registers new test modules for ipcs and ipcrm
sys/tests/ipcs/mod.rs Adds comprehensive tests for ipcs functionality including facility filters and print options
sys/tests/ipcrm/mod.rs Adds tests for ipcrm error handling and multi-object removal
sys/ipcs.rs Major refactoring: adds platform-specific IPC enumeration, improves output formatting, adds internationalization
sys/ipcrm.rs Changes arguments from Option to Vec for multi-object support, improves error handling and messages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +561 to +562
println!("{}", header);
println!("{}:", gettext("Semaphores"));
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue: the section label should be printed before the header line, not after it.

Suggested change
println!("{}", header);
println!("{}:", gettext("Semaphores"));
println!("{}:", gettext("Semaphores"));
println!("{}", header);

Copilot uses AI. Check for mistakes.
sys/ipcs.rs Outdated
Comment on lines 501 to 502
&owner[..owner.len().min(8)],
&group[..group.len().min(8)]
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same UTF-8 slicing issue: this can panic with multi-byte characters. Use character-aware truncation.

Copilot uses AI. Check for mistakes.
}

#[test]
fn ipcrm_no_args() {
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The test name ipcrm_no_args and its comment describe different expected behaviors. The function name suggests testing with no arguments, but the comment states "no IPC objects to remove is not an error". Consider renaming the test to ipcrm_no_args_succeeds to clarify that the test verifies successful execution with no arguments.

Suggested change
fn ipcrm_no_args() {
fn ipcrm_no_args_succeeds() {

Copilot uses AI. Check for mistakes.
Comment on lines +488 to +489
println!("{}", header);
println!("{}:", gettext("Shared Memory"));
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as with message queues: the section label should be printed before the header line, not after it.

Suggested change
println!("{}", header);
println!("{}:", gettext("Shared Memory"));
println!("{}:", gettext("Shared Memory"));
println!("{}", header);

Copilot uses AI. Check for mistakes.
@jgarzik jgarzik merged commit 00e92fe into main Dec 1, 2025
4 checks passed
@jgarzik jgarzik deleted the updates branch December 1, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cleanup enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants