From: Samuel Mendoza-Jonas Date: Tue, 22 Aug 2017 01:36:06 +0000 (+1000) Subject: discover/ipmi: Open devnode with O_CLOEXEC X-Git-Tag: v1.6.0~5 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=efcff0996d8c9a42e3bbef4a805ff65974684ff0;hp=675eb751ff84e80f286da808daa931a84baf9302;ds=inline discover/ipmi: Open devnode with O_CLOEXEC 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 --- diff --git a/discover/ipmi.c b/discover/ipmi.c index 2aaf114..d652e9f 100644 --- a/discover/ipmi.c +++ b/discover/ipmi.c @@ -201,7 +201,7 @@ struct ipmi *ipmi_open(void *ctx) 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;