rhboot / efibootmgr

efibootmgr development tree
GNU General Public License v2.0
514 stars 97 forks source link

efibootdump: fopen: use 'e' to set O_CLOEXEC #172

Closed matdibu closed 1 year ago

matdibu commented 2 years ago
src/efibootdump.c:230:23: warning: use 'fopen' mode 'e' to set O_CLOEXEC [android-cloexec-fopen]
                f = fopen(filename, "r");
                                    ^~~
                                    "re"
frozencemetery commented 2 years ago

efibootmgr doesn't exec, so the compiler is just being difficult... what compiler is it?

matdibu commented 2 years ago

this makes it so it automatically closes file descriptors on fork/exec It's good practice to avoid leaked file descriptors while not exactly happening here, it doesn't hurt to add it

frozencemetery commented 2 years ago

That's true, but now I'm concerned because you're not telling me what compiler you're encountering this with.

If you've not read this post on how to write effective commit messages, I recommend it. The important part for this conversation (and your other PRs) is to establish why a change is happening so that we have that information for the future.

frozencemetery commented 1 year ago

It's been several months; closing as inactive.