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

sync src/mtd_probe/*.[ch] #204

Merged
merged 1 commit into from
Oct 16, 2021
Merged

sync src/mtd_probe/*.[ch] #204

merged 1 commit into from
Oct 16, 2021

Conversation

bbonev
Copy link
Member

@bbonev bbonev commented Sep 27, 2021

Author: Lennart Poettering lennart@poettering.net
Date: Tue Apr 24 17:50:01 2018 +0200

mtd: some basic code cleanups

While looking at our exit() invocations I noticed that the mtd_probe
stuff uses 'exit(-1)' at various places, which is not really a good
idea, as exit codes of processes on Linux are supposed to be in the
range of 0…255.

This patch cleans that up a bit, and fixes a number of other things:

1. Let's always let main() exit, nothing intermediary. We generally
   don't like code that invokes exit() on its own.

2. Close the file descriptors opened.

3. Some logging for errors is added, mostly on debug level.

Please review this with extra care. As I don't have the right hardware
to test this patch I only did superficial testing.

systemd-commit: 41b9d436b2739cbe8bf9482b665d85d59d06bc0e

While looking at our exit() invocations I noticed that the mtd_probe
stuff uses 'exit(-1)' at various places, which is not really a good
idea, as exit codes of processes on Linux are supposed to be in the
range of 0…255.

This patch cleans that up a bit, and fixes a number of other things:

1. Let's always let main() exit, nothing intermediary. We generally
   don't like code that invokes exit() on its own.

2. Close the file descriptors opened.

3. Some logging for errors is added, mostly on debug level.

Please review this with extra care. As I don't have the right hardware
to test this patch I only did superficial testing.

systemd-commit: 41b9d436b2739cbe8bf9482b665d85d59d06bc0e
Author: Lennart Poettering <lennart@poettering.net>
Date:   Tue Apr 24 17:50:01 2018 +0200
@bbonev bbonev merged commit ffca0bb into eudev-project:master Oct 16, 2021
@bbonev bbonev deleted the s1mtd branch April 6, 2022 02:50
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