diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-05-08 23:32:29 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-05-08 23:32:29 +0200 |
commit | 38d4a182b7ccc4a683c1f9bcbe1da7779cc14832 (patch) | |
tree | 974665e1baf08a8ad70f2fbad970102bd1e7a8c8 /util/ipmimv.c | |
parent | 69786de63e325b2f4d9f1afc49b30dcf091b5220 (diff) | |
parent | 55adddbc16f65732b57ab8585c47001fced91d77 (diff) |
Merge tag 'upstream/2.9.9'
Upstream version 2.9.9
Diffstat (limited to 'util/ipmimv.c')
-rw-r--r-- | util/ipmimv.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/util/ipmimv.c b/util/ipmimv.c index accda41..8962ef5 100644 --- a/util/ipmimv.c +++ b/util/ipmimv.c @@ -241,6 +241,23 @@ static void dbgmsg(char *pattn, ...) fflush( fpdbg ); } +int set_cloexec(fd,fdebugcmd) +{ + int flags; + flags = fcntl(ipmi_fd, F_GETFD); + if (flags == -1) { + if (fdebugcmd) printf("fcntl(get) errno = %d\n",errno); + return -1; + } + flags |= FD_CLOEXEC; + if (fcntl(ipmi_fd, F_SETFD, flags) == -1) + { + if (fdebugcmd) printf("fcntl(set) errno = %d\n",errno); + return -1; + } + return 0; +} + int ipmi_open_mv(char fdebugcmd) { char *pdev; @@ -285,6 +302,7 @@ int ipmi_open_mv(char fdebugcmd) } } + set_cloexec(ipmi_fd,fdebugcmd); if (fdebugcmd) { dbgmsg("ipmi_open_mv: successfully opened %s, fd=%d\n",pdev,ipmi_fd); } |