From ac40435a4a2eb8c8db03e3dfcebe7fc08a132fc0 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 1 May 2006 23:15:38 +0000 Subject: [PATCH] connect before fork to return error to initscript if needed --- ipmitool/src/ipmievd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ipmitool/src/ipmievd.c b/ipmitool/src/ipmievd.c index 6bdec19..8e7fb6a 100644 --- a/ipmitool/src/ipmievd.c +++ b/ipmitool/src/ipmievd.c @@ -640,6 +640,16 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv) } } + /* + * We need to open interface before forking daemon + * so error messages are not lost to syslog and + * return code is successfully returned to initscript + */ + if (intf->open(intf) < 0) { + lprintf(LOG_ERR, "Unable to open interface"); + return -1; + } + if (daemon) { FILE *fp; struct stat st1;