Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtme-ng-init: always check return code when executing bash #220

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

arighi
Copy link
Owner

@arighi arighi commented Jan 23, 2025

Fix the following warning:

warning: unused return value of exec that must be used
--> src/main.rs:978:13
|
978 | Command::new("bash").arg("-l").exec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_must_use)] on by default

Moreover, check the return code in case exec() fails and log an explicit error before exiting.

Fix the following warning:

warning: unused return value of `exec` that must be used
   --> src/main.rs:978:13
    |
978 |             Command::new("bash").arg("-l").exec();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_must_use)]` on by default

Moreover, check the return code in case exec() fails and log an explicit
error before exiting.

Signed-off-by: Andrea Righi <[email protected]>
Copy link
Collaborator

@matttbe matttbe left a comment

Choose a reason for hiding this comment

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

thank you for this fix!

@arighi arighi merged commit ad68078 into main Jan 23, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants