The IPMI device node is kept open for the life of the platform - include
the O_CLOEXEC flag so it is not kept open for child processes.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
struct ipmi *ipmi;
int fd;
struct ipmi *ipmi;
int fd;
- fd = open(ipmi_devnode, O_RDWR);
+ fd = open(ipmi_devnode, O_RDWR | O_CLOEXEC);
if (fd < 0) {
pb_log("IPMI: can't open IPMI device %s: %m\n", ipmi_devnode);
return NULL;
if (fd < 0) {
pb_log("IPMI: can't open IPMI device %s: %m\n", ipmi_devnode);
return NULL;