From d5cdf594f2678cf690b802fbf4eb687dd9d98c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 14 Jan 2018 19:52:45 +0100 Subject: New upstream version 3.0.8 --- util/ipmidir.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'util/ipmidir.c') diff --git a/util/ipmidir.c b/util/ipmidir.c index 12b379c..0378d46 100644 --- a/util/ipmidir.c +++ b/util/ipmidir.c @@ -403,13 +403,13 @@ int ipmi_open_direct(int fdebugcmd) #endif } - /* Read ipmi_if config file data, if present. */ - status = get_ipmi_if(); - if (status == -1) { + /* Read ipmi_if config file data, if present. */ + status = get_ipmi_if(); + if (status == -1) { uchar iftype, iver, sa, inc; int mybase; - /* Read SMBIOS to get IPMI struct */ - status = get_IpmiStruct(&iftype,&iver,&sa,&mybase,&inc); + /* Read SMBIOS to get IPMI struct */ + status = get_IpmiStruct(&iftype,&iver,&sa,&mybase,&inc); if (status == 0) { if (iftype == 0x04) { g_DriverType = DRV_SMB; @@ -427,7 +427,7 @@ int ipmi_open_direct(int fdebugcmd) } else { return ERR_NO_DRV; /*no SMBIOS IPMI record*/ } - } + } #ifndef DOS /* superuser/root priv is required for direct I/Os */ @@ -438,20 +438,20 @@ int ipmi_open_direct(int fdebugcmd) } #endif /* check lock for driverless interface */ - i = check_lock_dir(); + i = check_lock_dir(); if (i != 0) { fprintf(stdout,"open_direct interface locked, %s in use\n", lock_dir_file); return ERR_NO_DRV; } - /* Find the SMBIOS IPMI driver type, data */ + /* Find the SMBIOS IPMI driver type, data */ status = ImbInit_dir(); DBGP2("open_direct Init status = %d\n",status); DBGP2("open_direct base=%x spacing=%d\n",BMC_base,kcs_inc); if (status == 0) { fDetectedIF = 1; /*Successfully detected interface */ - /* Send a command to the IPMI interface */ + /* Send a command to the IPMI interface */ if (!fjustpass) status = GetDeviceId(&g_bmcType,&g_ipmiVersion); if (status == 0) { @@ -459,14 +459,13 @@ int ipmi_open_direct(int fdebugcmd) if (g_DriverType == DRV_SMB) typ = "smb"; else typ = "kcs"; set_driver_type(typ); - } - } + } + /* set lock for driverless interface */ + i = set_lock_dir(); + } DBGP("open_direct: status=%d, %s drv, ipmi=%d\n", status,BmcDesc(g_DriverType),g_ipmiVersion); - - /* set lock for driverless interface */ - i = set_lock_dir(); - return status; + return status; } int ipmi_close_direct(void) -- cgit v1.2.3